Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cea242a17 | |||
| 65acd57b40 | |||
| 7e7fe3881e |
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace MicronSync
|
namespace MicronSync
|
||||||
{
|
{
|
||||||
@@ -8,28 +9,10 @@ namespace MicronSync
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class CommonIO : IDisposable
|
public class CommonIO : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Browse to existing folder on the system.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="originalPath"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string BrowseFolder(string originalPath)
|
|
||||||
{
|
|
||||||
// The result of the Windows Forms dialog is passed as a
|
|
||||||
// string to the method caller.
|
|
||||||
var folder = new System.Windows.Forms.FolderBrowserDialog();
|
|
||||||
System.Windows.Forms.DialogResult result = folder.ShowDialog();
|
|
||||||
|
|
||||||
// Only change the value if a valid path is entered.
|
|
||||||
string newPath;
|
|
||||||
if (folder.SelectedPath != "") { newPath = folder.SelectedPath.ToString(); }
|
|
||||||
else { newPath = originalPath; }
|
|
||||||
|
|
||||||
return newPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum FileType { sz, ini }
|
public enum FileType { sz, ini }
|
||||||
|
|
||||||
|
#region Filesystem
|
||||||
|
|
||||||
public string SaveFile(string originalPath, FileType f)
|
public string SaveFile(string originalPath, FileType f)
|
||||||
{
|
{
|
||||||
var file = new System.Windows.Forms.SaveFileDialog();
|
var file = new System.Windows.Forms.SaveFileDialog();
|
||||||
@@ -88,22 +71,45 @@ namespace MicronSync
|
|||||||
return newPath;
|
return newPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Browse to existing folder on the system.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="originalPath"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string BrowseFolder(string originalPath)
|
||||||
|
{
|
||||||
|
// The result of the Windows Forms dialog is passed as a
|
||||||
|
// string to the method caller.
|
||||||
|
var folder = new System.Windows.Forms.FolderBrowserDialog();
|
||||||
|
System.Windows.Forms.DialogResult result = folder.ShowDialog();
|
||||||
|
|
||||||
|
// Only change the value if a valid path is entered.
|
||||||
|
string newPath;
|
||||||
|
if (folder.SelectedPath != "") { newPath = folder.SelectedPath.ToString(); }
|
||||||
|
else { newPath = originalPath; }
|
||||||
|
|
||||||
|
return newPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double CalculateFileSizeMB (string file)
|
||||||
|
{
|
||||||
|
FileInfo fi = new FileInfo(file);
|
||||||
|
return ConvertBytesToMB(fi.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region String manipulation
|
||||||
|
|
||||||
public string CalculateDirectoryModifyDate (string dir)
|
public string CalculateDirectoryModifyDate (string dir)
|
||||||
{
|
{
|
||||||
string result = null;
|
string result = null;
|
||||||
try
|
if (Directory.Exists(dir))
|
||||||
{
|
result = string.Format("{0} - {1}",
|
||||||
if (Directory.Exists(dir))
|
Directory.GetLastWriteTime(dir).ToShortDateString(),
|
||||||
result = string.Format("{0} - {1}",
|
Directory.GetLastWriteTime(dir).ToLongTimeString());
|
||||||
Directory.GetLastWriteTime(dir).ToShortDateString(),
|
else
|
||||||
Directory.GetLastWriteTime(dir).ToLongTimeString());
|
result = "N/A";
|
||||||
else
|
|
||||||
result = "N/A";
|
|
||||||
}
|
|
||||||
catch (System.Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -111,23 +117,68 @@ namespace MicronSync
|
|||||||
public string CalculateFileModifyDate(string file)
|
public string CalculateFileModifyDate(string file)
|
||||||
{
|
{
|
||||||
string result = null;
|
string result = null;
|
||||||
try
|
if (File.Exists(file))
|
||||||
|
result = string.Format("{0} - {1}",
|
||||||
|
File.GetLastWriteTime(file).ToShortDateString(),
|
||||||
|
File.GetLastWriteTime(file).ToLongTimeString());
|
||||||
|
else
|
||||||
|
result = "N/A";
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetRootPath(string input)
|
||||||
|
{
|
||||||
|
string result = null;
|
||||||
|
Match unc = Regex.Match(input, @"(\\\\(\w+)\\)");
|
||||||
|
Match drive = Regex.Match(input, @"(\w:\\)");
|
||||||
|
|
||||||
|
string varPath = ConvertPathToVariable(input);
|
||||||
|
if (!string.IsNullOrEmpty(varPath))
|
||||||
|
result = varPath;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (File.Exists(file))
|
if (input.StartsWith(@"\\"))
|
||||||
result = string.Format("{0} - {1}",
|
result = unc.Value;
|
||||||
File.GetLastWriteTime(file).ToShortDateString(),
|
|
||||||
File.GetLastWriteTime(file).ToLongTimeString());
|
|
||||||
else
|
else
|
||||||
result = "N/A";
|
result = drive.Value;
|
||||||
}
|
|
||||||
catch (System.Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ConvertPathToVariable(string fullPath)
|
||||||
|
{
|
||||||
|
string result = null;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(fullPath))
|
||||||
|
foreach (var item in MSConfig.SysVars)
|
||||||
|
if (fullPath.StartsWith(item.Value))
|
||||||
|
{
|
||||||
|
result = item.Key;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ConvertVariableToPath(string variable)
|
||||||
|
{
|
||||||
|
string result = variable;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(variable))
|
||||||
|
foreach (var item in MSConfig.SysVars)
|
||||||
|
if (variable.StartsWith(item.Key))
|
||||||
|
{
|
||||||
|
result = item.Value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion.
|
||||||
|
|
||||||
#region Filesystem Modification
|
#region Filesystem Modification
|
||||||
|
|
||||||
public enum endResult
|
public enum endResult
|
||||||
@@ -135,7 +186,7 @@ namespace MicronSync
|
|||||||
ClearEntireDirectory_Error,
|
ClearEntireDirectory_Error,
|
||||||
CopyEntireDirectory_Error,
|
CopyEntireDirectory_Error,
|
||||||
Default,
|
Default,
|
||||||
FileNotExist,
|
RenameEntireDirectory_Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
public endResult ClearEntireDirectory(string dir)
|
public endResult ClearEntireDirectory(string dir)
|
||||||
@@ -167,6 +218,23 @@ namespace MicronSync
|
|||||||
return _endResult;
|
return _endResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public endResult RenameEntireDirectory(string dir, string newName)
|
||||||
|
{
|
||||||
|
endResult _endResult = endResult.Default;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.Move(dir, Path.Combine(
|
||||||
|
Path.GetDirectoryName(dir), newName));
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
_endResult = endResult.RenameEntireDirectory_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _endResult;
|
||||||
|
}
|
||||||
|
|
||||||
public endResult CopyEntireDirectory(string src, string dst)
|
public endResult CopyEntireDirectory(string src, string dst)
|
||||||
{
|
{
|
||||||
endResult _endResult = endResult.Default;
|
endResult _endResult = endResult.Default;
|
||||||
@@ -187,18 +255,13 @@ namespace MicronSync
|
|||||||
// Copy all files to destination.
|
// Copy all files to destination.
|
||||||
FileInfo[] files = dir.GetFiles();
|
FileInfo[] files = dir.GetFiles();
|
||||||
foreach (FileInfo file in files)
|
foreach (FileInfo file in files)
|
||||||
{
|
|
||||||
File.Copy(Path.Combine(src, file.Name),
|
File.Copy(Path.Combine(src, file.Name),
|
||||||
Path.Combine(dst, file.Name));
|
Path.Combine(dst, file.Name));
|
||||||
}
|
|
||||||
|
|
||||||
// Repeat for subdirectories.
|
// Repeat for subdirectories.
|
||||||
foreach (DirectoryInfo subDir in dirs)
|
foreach (DirectoryInfo subDir in dirs)
|
||||||
{
|
|
||||||
CopyEntireDirectory(subDir.FullName,
|
CopyEntireDirectory(subDir.FullName,
|
||||||
Path.Combine(dst, subDir.Name));
|
Path.Combine(dst, subDir.Name));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -210,9 +273,15 @@ namespace MicronSync
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void Dispose()
|
#region Conversion
|
||||||
|
|
||||||
|
public double ConvertBytesToMB(double bytes)
|
||||||
{
|
{
|
||||||
GC.Collect();
|
return Math.Round(bytes / 1024f / 1024f, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void Dispose() { GC.Collect(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
@@ -121,7 +121,7 @@
|
|||||||
<data name="logoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="logoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
wwAADsMBx2+oZAAAEWdJREFUeF7tnVlsVNcZx71gGy9gj7eZsT2e3UCI2QwY2zhgwmZWb0ASGkgDhKSQ
|
wgAADsIBFShKgAAAEWdJREFUeF7tnVlsVNcZx71gGy9gj7eZsT2e3UCI2QwY2zhgwmZWb0ASGkgDhKSQ
|
||||||
EDAEUUQTGkKCCJCUEiBsYYmqPlVRFVVVVVVVVUVVVEWoqqI+5KEPVVRVURWhKKoidPv9L3OGc6/PeO42
|
EDAEUUQTGkKCCJCUEiBsYYmqPlVRFVVVVVVVVUVVVEWoqqI+5KEPVVRVURWhKKoidPv9L3OGc6/PeO42
|
||||||
dyae8/CTrHs8Z/v+33fPOffccwsURSmU5C9SAHmOFECeIwWQ50gB5DlSAHmOIQEUFBQUc5R8DynTUZ4C
|
dyae8/CTrHs8Z/v+33fPOffccwsURSmU5C9SAHmOFECeIwWQ50gB5DlSAHmOIQEUFBQUc5R8DynTUZ4C
|
||||||
/f+J8sp1VDuJ7CgirQASGSJjvuMqc4QpAqoTeBLUJWjQ4eXQpwH2O5YPy1dUpqhu2YAXsioGkU15xhUA
|
/f+J8sp1VDuJ7CgirQASGSJjvuMqc4QpAqoTeBLUJWjQ4eXQpwH2O5YPy1dUpqhu2YAXsioGkU15xhUA
|
||||||
+82
@@ -0,0 +1,82 @@
|
|||||||
|
namespace MicronSync.Components
|
||||||
|
{
|
||||||
|
partial class ChangeLog
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangeLog));
|
||||||
|
this.richTextBox = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.labelVersionInfo = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// richTextBox
|
||||||
|
//
|
||||||
|
this.richTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.richTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.richTextBox.Location = new System.Drawing.Point(13, 38);
|
||||||
|
this.richTextBox.Name = "richTextBox";
|
||||||
|
this.richTextBox.ReadOnly = true;
|
||||||
|
this.richTextBox.Size = new System.Drawing.Size(679, 360);
|
||||||
|
this.richTextBox.TabIndex = 0;
|
||||||
|
this.richTextBox.Text = "";
|
||||||
|
//
|
||||||
|
// labelVersionInfo
|
||||||
|
//
|
||||||
|
this.labelVersionInfo.AutoSize = true;
|
||||||
|
this.labelVersionInfo.Location = new System.Drawing.Point(13, 13);
|
||||||
|
this.labelVersionInfo.Name = "labelVersionInfo";
|
||||||
|
this.labelVersionInfo.Size = new System.Drawing.Size(45, 13);
|
||||||
|
this.labelVersionInfo.TabIndex = 1;
|
||||||
|
this.labelVersionInfo.Text = "Version:";
|
||||||
|
//
|
||||||
|
// ChangeLog
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.ClientSize = new System.Drawing.Size(704, 411);
|
||||||
|
this.Controls.Add(this.labelVersionInfo);
|
||||||
|
this.Controls.Add(this.richTextBox);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.MinimumSize = new System.Drawing.Size(400, 450);
|
||||||
|
this.Name = "ChangeLog";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
this.Text = "MicronSync - Change Log";
|
||||||
|
this.Load += new System.EventHandler(this.ChangeLog_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.RichTextBox richTextBox;
|
||||||
|
private System.Windows.Forms.Label labelVersionInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace MicronSync.Components
|
||||||
|
{
|
||||||
|
public partial class ChangeLog : Form
|
||||||
|
{
|
||||||
|
public ChangeLog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeLog_Load(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
var assembly = Assembly.GetExecutingAssembly();
|
||||||
|
|
||||||
|
labelVersionInfo.Text = $"MicronSync: {assembly.GetName().Version}";
|
||||||
|
|
||||||
|
using (Stream steam = assembly.GetManifestResourceStream("MicronSync.Components.Forms.ChangeLog.txt"))
|
||||||
|
using (StreamReader sr = new StreamReader(steam, true))
|
||||||
|
{
|
||||||
|
List<string> listChangelog = new List<string>();
|
||||||
|
|
||||||
|
string currentLine;
|
||||||
|
while (!string.IsNullOrEmpty(
|
||||||
|
currentLine = sr.ReadLine()))
|
||||||
|
{
|
||||||
|
if (currentLine.Contains(@"//"))
|
||||||
|
{
|
||||||
|
currentLine = currentLine.Remove(currentLine.IndexOf(@"//"));
|
||||||
|
if (!string.IsNullOrEmpty(currentLine))
|
||||||
|
listChangelog.Add(currentLine);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
listChangelog.Add(currentLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
richTextBox.Text = string.Join(Environment.NewLine, listChangelog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
|||||||
|
[New Features]
|
||||||
|
- Browse directly to any of the backup and restore paths with a conveniently placed shortcut.
|
||||||
|
- Restore backups can now be triggered every time a restore operation is run.
|
||||||
|
- Choose between dark and light themes which are persistent on the system..
|
||||||
|
|
||||||
|
[Enhancements]
|
||||||
|
- Ability to resize main window horizontally for easier legibility of long paths. Horizontal window size is
|
||||||
|
also stored in a per config basis to accommodate different jobs.
|
||||||
|
|
||||||
|
[MicronSync 1.2.5.1]-------------------------------------------------------------------------------
|
||||||
|
[Enhancements]
|
||||||
|
- MicronSync now notifies you when importing an invalid or bad configuration file.
|
||||||
|
|
||||||
|
[MicronSync 1.2.5.0]-------------------------------------------------------------------------------
|
||||||
|
[New Features]
|
||||||
|
- The size of the source backup directory can now be calculated within MicronSync.
|
||||||
|
- Backups created can have their size shown once calculated from the restore tab.
|
||||||
|
|
||||||
|
[Enhancements]
|
||||||
|
- MicronSync now prompts to save unsaved changes prior to loading a new config or creating a new one.
|
||||||
|
|
||||||
|
[MicronSync 1.2.1.0]-------------------------------------------------------------------------------
|
||||||
|
[New Features]
|
||||||
|
- Completion time added to backup and restore tasks.
|
||||||
|
- Compression presets for quicker and more optimal compression.
|
||||||
|
|
||||||
|
[Enhancements]
|
||||||
|
- Ability to refresh list of available drives on the fly.
|
||||||
|
|
||||||
|
[MicronSync 1.2.0.0]-------------------------------------------------------------------------------
|
||||||
|
// Comments are denoted at the beginning of a line with two forward slashes.
|
||||||
|
//
|
||||||
|
[New Features]
|
||||||
|
- Paths have been partitioned to allow use of environment variables.
|
||||||
|
- Directories which start with supported environment variables are automatically detected upon import.
|
||||||
|
- Automatic conversion of environment variables for paths dragged in from explorer or browsed to from directory selector.
|
||||||
|
|
||||||
|
[Enhancements]
|
||||||
|
- User interface redesigned to be more user friendly.
|
||||||
|
- The Backup/Restore tab selection is now saved as part of config files.
|
||||||
|
- Compression level indicator added beside slider control.
|
||||||
|
|
||||||
|
[Notes]
|
||||||
|
- Old configuration files cannot be used with this new version due to changes made to paths. Sorry for the inconvenience!
|
||||||
|
|
||||||
|
[MicronSync 1.1.0.1]-------------------------------------------------------------------------------
|
||||||
|
[Bug Fixes]
|
||||||
|
- Fixed new pre-backup algorithm from placing backup inside of source directory when the path ended with a "\".
|
||||||
|
|
||||||
|
[MicronSync 1.1.0.0]-------------------------------------------------------------------------------
|
||||||
|
[New Features]
|
||||||
|
- Inclusion of a changelog (the very thing you currently have open!)
|
||||||
|
- Ability to replicate destination and source paths between backup and restore tabs.
|
||||||
|
- Drag and drop interface for 7-Zip archives and directories for more rapid operation.
|
||||||
|
|
||||||
|
[Enhancements]
|
||||||
|
- Automatic save prompt only appears when a change has been made to the configuration since the last save.
|
||||||
|
- Paths are now validated ahead of attempting job operation.
|
||||||
|
- User interface adjustments.
|
||||||
|
- Shortcut keys for file menu!
|
||||||
|
- Source directory pre-backups are a lot faster due to much more efficient algorithm (depending on settings used).
|
||||||
|
|
||||||
|
[Bug Fixes]
|
||||||
|
- Directories could be confused as files when checking paths are not in one another.
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
namespace MicronSync.Components.Forms
|
||||||
|
{
|
||||||
|
partial class DirSizeCalculatorPrompt
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.buttonCancel = new System.Windows.Forms.Button();
|
||||||
|
this.labelCalculating = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
this.buttonCancel.Location = new System.Drawing.Point(100, 76);
|
||||||
|
this.buttonCancel.Name = "buttonCancel";
|
||||||
|
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.buttonCancel.TabIndex = 3;
|
||||||
|
this.buttonCancel.Text = "Cancel";
|
||||||
|
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||||
|
//
|
||||||
|
// labelCalculating
|
||||||
|
//
|
||||||
|
this.labelCalculating.AutoSize = true;
|
||||||
|
this.labelCalculating.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.labelCalculating.Location = new System.Drawing.Point(13, 13);
|
||||||
|
this.labelCalculating.Name = "labelCalculating";
|
||||||
|
this.labelCalculating.Size = new System.Drawing.Size(257, 25);
|
||||||
|
this.labelCalculating.TabIndex = 2;
|
||||||
|
this.labelCalculating.Text = "Calculating, please wait...";
|
||||||
|
//
|
||||||
|
// DirSizeCalculatorPrompt
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(284, 111);
|
||||||
|
this.Controls.Add(this.buttonCancel);
|
||||||
|
this.Controls.Add(this.labelCalculating);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||||
|
this.Name = "DirSizeCalculatorPrompt";
|
||||||
|
this.ShowInTaskbar = false;
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
this.Text = "MicronSync";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DirSizeCalculatorPrompt_FormClosing);
|
||||||
|
this.Load += new System.EventHandler(this.DirSizeCalculatorPrompt_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button buttonCancel;
|
||||||
|
private System.Windows.Forms.Label labelCalculating;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace MicronSync.Components.Forms
|
||||||
|
{
|
||||||
|
public partial class DirSizeCalculatorPrompt : Form
|
||||||
|
{
|
||||||
|
public DirSizeCalculatorPrompt()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
BackgroundWorker bw = new BackgroundWorker();
|
||||||
|
public string TargetDirectory;
|
||||||
|
public double Result = 0;
|
||||||
|
private bool canClose;
|
||||||
|
|
||||||
|
#region Worker
|
||||||
|
|
||||||
|
private void FinishCalculation(object sender, RunWorkerCompletedEventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StartCalculation(object sender, DoWorkEventArgs e)
|
||||||
|
{
|
||||||
|
double result = 0;
|
||||||
|
|
||||||
|
string[] allFiles = Directory.GetFiles(TargetDirectory, "*.*", SearchOption.AllDirectories);
|
||||||
|
foreach (var file in allFiles)
|
||||||
|
{
|
||||||
|
if (!bw.CancellationPending)
|
||||||
|
{
|
||||||
|
FileInfo info = new FileInfo(file);
|
||||||
|
result += info.Length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (CommonIO _cio = new CommonIO())
|
||||||
|
Result = _cio.ConvertBytesToMB(result);
|
||||||
|
|
||||||
|
canClose = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region UI
|
||||||
|
|
||||||
|
private void DirSizeCalculatorPrompt_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
bw.WorkerSupportsCancellation = true;
|
||||||
|
bw.DoWork += new DoWorkEventHandler(StartCalculation);
|
||||||
|
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(FinishCalculation);
|
||||||
|
bw.RunWorkerAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DirSizeCalculatorPrompt_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
bw.Dispose();
|
||||||
|
GC.Collect();
|
||||||
|
|
||||||
|
if (!canClose)
|
||||||
|
e.Cancel = true;
|
||||||
|
else
|
||||||
|
e.Cancel = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
bw.CancelAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
@@ -56,7 +56,7 @@ namespace MicronSync.Components
|
|||||||
while (progWait.Value < 100 &&
|
while (progWait.Value < 100 &&
|
||||||
!timerStopped)
|
!timerStopped)
|
||||||
{
|
{
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(250);
|
||||||
position += stepAmount;
|
position += stepAmount;
|
||||||
bwTimer.ReportProgress(position);
|
bwTimer.ReportProgress(position);
|
||||||
}
|
}
|
||||||
+227
@@ -0,0 +1,227 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace MicronSync.Components.Forms
|
||||||
|
{
|
||||||
|
partial class DropUI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.tabControl = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabProcess = new System.Windows.Forms.TabPage();
|
||||||
|
this.labelIdentify = new System.Windows.Forms.Label();
|
||||||
|
this.tabSz = new System.Windows.Forms.TabPage();
|
||||||
|
this.textReadSz = new System.Windows.Forms.TextBox();
|
||||||
|
this.btnSzUseBackup = new System.Windows.Forms.Button();
|
||||||
|
this.btnSzUseRestore = new System.Windows.Forms.Button();
|
||||||
|
this.labelSz = new System.Windows.Forms.Label();
|
||||||
|
this.tabDir = new System.Windows.Forms.TabPage();
|
||||||
|
this.textReadPath = new System.Windows.Forms.TextBox();
|
||||||
|
this.btnDirRestore = new System.Windows.Forms.Button();
|
||||||
|
this.btnDirBackup = new System.Windows.Forms.Button();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.tabControl.SuspendLayout();
|
||||||
|
this.tabProcess.SuspendLayout();
|
||||||
|
this.tabSz.SuspendLayout();
|
||||||
|
this.tabDir.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// tabControl
|
||||||
|
//
|
||||||
|
this.tabControl.Controls.Add(this.tabProcess);
|
||||||
|
this.tabControl.Controls.Add(this.tabSz);
|
||||||
|
this.tabControl.Controls.Add(this.tabDir);
|
||||||
|
this.tabControl.Location = new System.Drawing.Point(13, 13);
|
||||||
|
this.tabControl.Name = "tabControl";
|
||||||
|
this.tabControl.SelectedIndex = 0;
|
||||||
|
this.tabControl.Size = new System.Drawing.Size(474, 166);
|
||||||
|
this.tabControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabProcess
|
||||||
|
//
|
||||||
|
this.tabProcess.Controls.Add(this.labelIdentify);
|
||||||
|
this.tabProcess.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabProcess.Name = "tabProcess";
|
||||||
|
this.tabProcess.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabProcess.Size = new System.Drawing.Size(466, 140);
|
||||||
|
this.tabProcess.TabIndex = 0;
|
||||||
|
this.tabProcess.Text = "Identification";
|
||||||
|
this.tabProcess.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// labelIdentify
|
||||||
|
//
|
||||||
|
this.labelIdentify.AutoSize = true;
|
||||||
|
this.labelIdentify.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.labelIdentify.Location = new System.Drawing.Point(50, 56);
|
||||||
|
this.labelIdentify.Name = "labelIdentify";
|
||||||
|
this.labelIdentify.Size = new System.Drawing.Size(354, 31);
|
||||||
|
this.labelIdentify.TabIndex = 0;
|
||||||
|
this.labelIdentify.Text = "Identifying dropped item...";
|
||||||
|
//
|
||||||
|
// tabSz
|
||||||
|
//
|
||||||
|
this.tabSz.Controls.Add(this.textReadSz);
|
||||||
|
this.tabSz.Controls.Add(this.btnSzUseBackup);
|
||||||
|
this.tabSz.Controls.Add(this.btnSzUseRestore);
|
||||||
|
this.tabSz.Controls.Add(this.labelSz);
|
||||||
|
this.tabSz.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabSz.Name = "tabSz";
|
||||||
|
this.tabSz.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabSz.Size = new System.Drawing.Size(466, 140);
|
||||||
|
this.tabSz.TabIndex = 1;
|
||||||
|
this.tabSz.Text = "7-Zip File";
|
||||||
|
this.tabSz.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// textReadSz
|
||||||
|
//
|
||||||
|
this.textReadSz.Location = new System.Drawing.Point(80, 60);
|
||||||
|
this.textReadSz.Name = "textReadSz";
|
||||||
|
this.textReadSz.ReadOnly = true;
|
||||||
|
this.textReadSz.Size = new System.Drawing.Size(307, 20);
|
||||||
|
this.textReadSz.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// btnSzUseBackup
|
||||||
|
//
|
||||||
|
this.btnSzUseBackup.Location = new System.Drawing.Point(225, 90);
|
||||||
|
this.btnSzUseBackup.Name = "btnSzUseBackup";
|
||||||
|
this.btnSzUseBackup.Size = new System.Drawing.Size(162, 23);
|
||||||
|
this.btnSzUseBackup.TabIndex = 2;
|
||||||
|
this.btnSzUseBackup.Text = "Replace file with backup";
|
||||||
|
this.btnSzUseBackup.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSzUseBackup.Click += new System.EventHandler(this.btnSzUseBackup_Click);
|
||||||
|
//
|
||||||
|
// btnSzUseRestore
|
||||||
|
//
|
||||||
|
this.btnSzUseRestore.Location = new System.Drawing.Point(80, 90);
|
||||||
|
this.btnSzUseRestore.Name = "btnSzUseRestore";
|
||||||
|
this.btnSzUseRestore.Size = new System.Drawing.Size(139, 23);
|
||||||
|
this.btnSzUseRestore.TabIndex = 1;
|
||||||
|
this.btnSzUseRestore.Text = "Restore from backup file";
|
||||||
|
this.btnSzUseRestore.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSzUseRestore.Click += new System.EventHandler(this.btnSzUseRestore_Click);
|
||||||
|
//
|
||||||
|
// labelSz
|
||||||
|
//
|
||||||
|
this.labelSz.AutoSize = true;
|
||||||
|
this.labelSz.Location = new System.Drawing.Point(115, 30);
|
||||||
|
this.labelSz.Name = "labelSz";
|
||||||
|
this.labelSz.Size = new System.Drawing.Size(233, 13);
|
||||||
|
this.labelSz.TabIndex = 0;
|
||||||
|
this.labelSz.Text = "Please choose what to do with the following file:";
|
||||||
|
//
|
||||||
|
// tabDir
|
||||||
|
//
|
||||||
|
this.tabDir.Controls.Add(this.textReadPath);
|
||||||
|
this.tabDir.Controls.Add(this.btnDirRestore);
|
||||||
|
this.tabDir.Controls.Add(this.btnDirBackup);
|
||||||
|
this.tabDir.Controls.Add(this.label1);
|
||||||
|
this.tabDir.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabDir.Name = "tabDir";
|
||||||
|
this.tabDir.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabDir.Size = new System.Drawing.Size(466, 140);
|
||||||
|
this.tabDir.TabIndex = 2;
|
||||||
|
this.tabDir.Text = "Directory";
|
||||||
|
this.tabDir.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// textReadPath
|
||||||
|
//
|
||||||
|
this.textReadPath.Location = new System.Drawing.Point(80, 60);
|
||||||
|
this.textReadPath.Name = "textReadPath";
|
||||||
|
this.textReadPath.ReadOnly = true;
|
||||||
|
this.textReadPath.Size = new System.Drawing.Size(307, 20);
|
||||||
|
this.textReadPath.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// btnDirRestore
|
||||||
|
//
|
||||||
|
this.btnDirRestore.Location = new System.Drawing.Point(225, 90);
|
||||||
|
this.btnDirRestore.Name = "btnDirRestore";
|
||||||
|
this.btnDirRestore.Size = new System.Drawing.Size(162, 23);
|
||||||
|
this.btnDirRestore.TabIndex = 5;
|
||||||
|
this.btnDirRestore.Text = "Restore to path";
|
||||||
|
this.btnDirRestore.UseVisualStyleBackColor = true;
|
||||||
|
this.btnDirRestore.Click += new System.EventHandler(this.btnDirRestore_Click);
|
||||||
|
//
|
||||||
|
// btnDirBackup
|
||||||
|
//
|
||||||
|
this.btnDirBackup.Location = new System.Drawing.Point(80, 90);
|
||||||
|
this.btnDirBackup.Name = "btnDirBackup";
|
||||||
|
this.btnDirBackup.Size = new System.Drawing.Size(139, 23);
|
||||||
|
this.btnDirBackup.TabIndex = 4;
|
||||||
|
this.btnDirBackup.Text = "Backup this path";
|
||||||
|
this.btnDirBackup.UseVisualStyleBackColor = true;
|
||||||
|
this.btnDirBackup.Click += new System.EventHandler(this.btnDirBackup_Click);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(115, 30);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(241, 13);
|
||||||
|
this.label1.TabIndex = 3;
|
||||||
|
this.label1.Text = "Please choose what to do with the following path:";
|
||||||
|
//
|
||||||
|
// DropUI
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(499, 191);
|
||||||
|
this.Controls.Add(this.tabControl);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||||
|
this.Name = "DropUI";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
this.Text = "MicronSync - Dropped item";
|
||||||
|
this.Shown += new System.EventHandler(this.DropUI_Shown);
|
||||||
|
this.tabControl.ResumeLayout(false);
|
||||||
|
this.tabProcess.ResumeLayout(false);
|
||||||
|
this.tabProcess.PerformLayout();
|
||||||
|
this.tabSz.ResumeLayout(false);
|
||||||
|
this.tabSz.PerformLayout();
|
||||||
|
this.tabDir.ResumeLayout(false);
|
||||||
|
this.tabDir.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private TabControl tabControl;
|
||||||
|
private TabPage tabProcess;
|
||||||
|
private Label labelIdentify;
|
||||||
|
private TabPage tabSz;
|
||||||
|
private TabPage tabDir;
|
||||||
|
private Button btnSzUseBackup;
|
||||||
|
private Button btnSzUseRestore;
|
||||||
|
private Label labelSz;
|
||||||
|
private Button btnDirRestore;
|
||||||
|
private Button btnDirBackup;
|
||||||
|
private Label label1;
|
||||||
|
private TextBox textReadSz;
|
||||||
|
private TextBox textReadPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace MicronSync.Components.Forms
|
||||||
|
{
|
||||||
|
public partial class DropUI : Form
|
||||||
|
{
|
||||||
|
public static string dropData { get; set; }
|
||||||
|
public DropAction DropResult = DropAction.Cancelled; // Default behaviour
|
||||||
|
public enum DropAction
|
||||||
|
{
|
||||||
|
SzUseRestore,
|
||||||
|
SzUseBackup,
|
||||||
|
DirUseBackup,
|
||||||
|
DirUseRestore,
|
||||||
|
LoadConfig,
|
||||||
|
UnsupportedData,
|
||||||
|
Cancelled
|
||||||
|
}
|
||||||
|
|
||||||
|
public DropUI() { InitializeComponent(); }
|
||||||
|
|
||||||
|
private void DropUI_Shown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BringToFront();
|
||||||
|
|
||||||
|
// Idenfify dropped data
|
||||||
|
FileAttributes attr = File.GetAttributes(DropUI.dropData);
|
||||||
|
if (dropData.EndsWith(".ini"))
|
||||||
|
{
|
||||||
|
DropResult = DropAction.LoadConfig;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
else if (dropData.EndsWith(".7z"))
|
||||||
|
LoadSzHandler();
|
||||||
|
else if (attr == FileAttributes.Directory)
|
||||||
|
LoadDirHandler();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DropResult = DropAction.UnsupportedData;
|
||||||
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile, null);
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadDirHandler()
|
||||||
|
{
|
||||||
|
textReadPath.Text = dropData;
|
||||||
|
tabControl.TabPages.Remove(tabProcess);
|
||||||
|
tabControl.TabPages.Remove(tabSz);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadSzHandler()
|
||||||
|
{
|
||||||
|
textReadSz.Text = dropData;
|
||||||
|
tabControl.TabPages.Remove(tabProcess);
|
||||||
|
tabControl.TabPages.Remove(tabDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Form UI
|
||||||
|
|
||||||
|
private void btnDirBackup_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DropResult = DropAction.DirUseBackup;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnDirRestore_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DropResult = DropAction.DirUseRestore;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSzUseRestore_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DropResult = DropAction.SzUseRestore;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSzUseBackup_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DropResult = DropAction.SzUseBackup;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
Generated
+1
@@ -61,6 +61,7 @@
|
|||||||
this.Controls.Add(this.labelProcessing);
|
this.Controls.Add(this.labelProcessing);
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||||
this.Name = "WorkerUI";
|
this.Name = "WorkerUI";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
this.Text = "MicronSync";
|
this.Text = "MicronSync";
|
||||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WorkerUI_FormClosing);
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WorkerUI_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.WorkerUI_Load);
|
this.Load += new System.EventHandler(this.WorkerUI_Load);
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Threading;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace MicronSync.Components
|
namespace MicronSync.Components
|
||||||
@@ -21,7 +17,9 @@ namespace MicronSync.Components
|
|||||||
}
|
}
|
||||||
public LMZAParser.endResult _endResultLMZA = LMZAParser.endResult.Default;
|
public LMZAParser.endResult _endResultLMZA = LMZAParser.endResult.Default;
|
||||||
public CommonIO.endResult _endResultCIO = CommonIO.endResult.Default;
|
public CommonIO.endResult _endResultCIO = CommonIO.endResult.Default;
|
||||||
private readonly MSConfig _ManageConfig_RO = MainWindow._MSConfig;
|
private readonly MSConfig _MSConfig = MainWindow._MSConfig;
|
||||||
|
private Stopwatch stopWatch = new Stopwatch();
|
||||||
|
public TimeSpan compTime;
|
||||||
|
|
||||||
public WorkerUI()
|
public WorkerUI()
|
||||||
{
|
{
|
||||||
@@ -43,10 +41,10 @@ namespace MicronSync.Components
|
|||||||
private void LmzaBackup_DoWork(object sender, DoWorkEventArgs e)
|
private void LmzaBackup_DoWork(object sender, DoWorkEventArgs e)
|
||||||
{
|
{
|
||||||
_endResultLMZA = lmzaParser.MakePackage(
|
_endResultLMZA = lmzaParser.MakePackage(
|
||||||
Path.GetFileName(_ManageConfig_RO.BackupDestination),
|
Path.GetFileName(_MSConfig.BackupDestination),
|
||||||
_ManageConfig_RO.BackupSource,
|
_MSConfig.BackupSource,
|
||||||
Path.GetDirectoryName(_ManageConfig_RO.BackupDestination),
|
Path.GetDirectoryName(_MSConfig.BackupDestination),
|
||||||
_ManageConfig_RO.CompressionLevel,
|
_MSConfig.CompressionLevel,
|
||||||
"",
|
"",
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
@@ -59,45 +57,56 @@ namespace MicronSync.Components
|
|||||||
|
|
||||||
private void LmzaRestore_DoWork(object sender, DoWorkEventArgs e)
|
private void LmzaRestore_DoWork(object sender, DoWorkEventArgs e)
|
||||||
{
|
{
|
||||||
// Only continue if file exists!
|
// Process params.
|
||||||
bool fileExists = false;
|
using (CommonIO cio = new CommonIO())
|
||||||
if (File.Exists(_ManageConfig_RO.RestoreSource))
|
|
||||||
fileExists = true;
|
|
||||||
else
|
|
||||||
_endResultCIO = CommonIO.endResult.FileNotExist;
|
|
||||||
|
|
||||||
// Only continue if above is true.
|
|
||||||
if (fileExists)
|
|
||||||
{
|
{
|
||||||
// Process params.
|
var restoreBackupDir = _MSConfig.RestoreDestination + ".Backup";
|
||||||
using (CommonIO cio = new CommonIO())
|
|
||||||
|
// Clear out old backup directory if it exists.
|
||||||
|
if (_MSConfig.OverwriteBackup && Directory.Exists(restoreBackupDir))
|
||||||
{
|
{
|
||||||
if (_ManageConfig_RO.EnableBackup)
|
Directory.Delete(restoreBackupDir, true);
|
||||||
{
|
Thread.Sleep(500); // Delay needed for reliability!
|
||||||
_endResultCIO = cio.CopyEntireDirectory(_ManageConfig_RO.RestoreDestination,
|
|
||||||
_ManageConfig_RO.RestoreDestination + ".Backup");
|
|
||||||
}
|
|
||||||
if (_ManageConfig_RO.EnablePurge)
|
|
||||||
_endResultCIO = cio.ClearEntireDirectory(_ManageConfig_RO.RestoreDestination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_endResultCIO == CommonIO.endResult.Default)
|
// Move source directory if also purging, otherwise perform standard copy.
|
||||||
_endResultLMZA = lmzaParser.ExtractPackage(
|
if (_MSConfig.EnableBackup && !_MSConfig.EnablePurge)
|
||||||
Path.GetFileName(_ManageConfig_RO.RestoreSource),
|
{
|
||||||
Path.GetDirectoryName(_ManageConfig_RO.RestoreSource),
|
_endResultCIO = cio.CopyEntireDirectory(
|
||||||
_ManageConfig_RO.RestoreDestination,
|
_MSConfig.RestoreDestination,
|
||||||
"");
|
restoreBackupDir);
|
||||||
|
}
|
||||||
|
else if (_MSConfig.EnableBackup && _MSConfig.EnablePurge)
|
||||||
|
{
|
||||||
|
_endResultCIO = cio.RenameEntireDirectory(
|
||||||
|
_MSConfig.RestoreDestination,
|
||||||
|
restoreBackupDir);
|
||||||
|
Directory.CreateDirectory(_MSConfig.RestoreDestination);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_MSConfig.EnablePurge)
|
||||||
|
_endResultCIO = cio.ClearEntireDirectory(_MSConfig.RestoreDestination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_endResultCIO == CommonIO.endResult.Default)
|
||||||
|
_endResultLMZA = lmzaParser.ExtractPackage(
|
||||||
|
Path.GetFileName(_MSConfig.RestoreSource),
|
||||||
|
Path.GetDirectoryName(_MSConfig.RestoreSource),
|
||||||
|
_MSConfig.RestoreDestination,
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Form Functionality
|
#region Form Functionality
|
||||||
|
|
||||||
private bool canClose = false;
|
private bool canClose;
|
||||||
|
|
||||||
private void WorkerUI_Load(object sender, EventArgs e)
|
private void WorkerUI_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// Start stopwatch.
|
||||||
|
stopWatch.Start();
|
||||||
|
|
||||||
switch (SetWorkerMode)
|
switch (SetWorkerMode)
|
||||||
{
|
{
|
||||||
case WorkerMode.Backup:
|
case WorkerMode.Backup:
|
||||||
@@ -120,6 +129,13 @@ namespace MicronSync.Components
|
|||||||
|
|
||||||
private void WorkerUI_FormClosing(object sender, FormClosingEventArgs e)
|
private void WorkerUI_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
// Stop stopwatch.
|
||||||
|
stopWatch.Stop();
|
||||||
|
compTime = new TimeSpan(
|
||||||
|
stopWatch.Elapsed.Hours,
|
||||||
|
stopWatch.Elapsed.Minutes,
|
||||||
|
stopWatch.Elapsed.Seconds);
|
||||||
|
|
||||||
if (!canClose)
|
if (!canClose)
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
else
|
else
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@@ -1,44 +1,35 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace MicronSync.Components
|
namespace MicronSync.Components
|
||||||
{
|
{
|
||||||
public class Licencer
|
public class Licencer
|
||||||
{
|
{
|
||||||
private readonly string privateKey = "TRZzjAutdtA542aeQj";
|
private readonly string privateKey = "TRZzjAutdtA542aeQj";
|
||||||
private readonly string msRegPath = @"SOFTWARE\MicronSync\";
|
private static SimplerAES aes = new SimplerAES(Encoding.ASCII.GetBytes(GetMachineGUID()));
|
||||||
private readonly string msRegKey = "Key";
|
|
||||||
public static bool isRegistered { get; set; } = false;
|
public static bool isRegistered { get; set; } = false;
|
||||||
|
|
||||||
public bool CheckForExistingLicence()
|
public bool CheckForExistingLicence()
|
||||||
{
|
{
|
||||||
bool licenceExists = false;
|
bool isValidKey = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var regPath = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
|
isValidKey = ValidateKey(
|
||||||
var regKey = regPath?.OpenSubKey(msRegPath);
|
aes.Decrypt(Settings.Default.UserLicenseKey));
|
||||||
var value = regKey?.GetValue(msRegKey);
|
|
||||||
|
|
||||||
bool isValidKey = ValidateKey((string)value);
|
|
||||||
|
|
||||||
if (isValidKey)
|
|
||||||
{
|
|
||||||
licenceExists = true;
|
|
||||||
}
|
|
||||||
else if (regKey != null && !isValidKey)
|
|
||||||
{
|
|
||||||
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
|
|
||||||
Environment.Exit(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception) { isValidKey = false; }
|
||||||
|
|
||||||
|
if (isValidKey == false && Settings.Default.UserLicenseKey != string.Empty)
|
||||||
{
|
{
|
||||||
licenceExists = false;
|
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
|
||||||
|
Settings.Default.UserLicenseKey = string.Empty;
|
||||||
|
Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return licenceExists;
|
return isValidKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowDonationPrompt()
|
public void ShowDonationPrompt()
|
||||||
@@ -47,6 +38,18 @@ namespace MicronSync.Components
|
|||||||
dui.ShowDialog();
|
dui.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Windows GUID.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static string GetMachineGUID()
|
||||||
|
{
|
||||||
|
var regPath = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default);
|
||||||
|
var regKey = regPath?.OpenSubKey(@"SOFTWARE\Microsoft\Cryptography");
|
||||||
|
|
||||||
|
return regKey.GetValue("MachineGuid").ToString().Replace("-", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns legitimacy of key.
|
/// Returns legitimacy of key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -62,21 +65,13 @@ namespace MicronSync.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stores key into user level registry.
|
/// Stores key into user level AppData.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
public void SetKey(string key)
|
public void SetKey(string key)
|
||||||
{
|
{
|
||||||
try
|
Settings.Default.UserLicenseKey = aes.Encrypt(key);
|
||||||
{
|
Settings.Default.Save();
|
||||||
var regPath = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
|
|
||||||
var regKey = regPath.CreateSubKey(msRegPath);
|
|
||||||
regKey.SetValue(msRegKey, key.ToUpper(), RegistryValueKind.String);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ namespace MicronSync
|
|||||||
MainWindow_Warn_OverwriteFile,
|
MainWindow_Warn_OverwriteFile,
|
||||||
NewRegKeyUI_CorrectKey,
|
NewRegKeyUI_CorrectKey,
|
||||||
MainWindow_SaveChanges,
|
MainWindow_SaveChanges,
|
||||||
|
MainWindow_LoadIncompatible,
|
||||||
|
MainWindow_SZNotInstalled,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum errCodes
|
public enum errCodes
|
||||||
{
|
{
|
||||||
_TestSample,
|
_TestSample,
|
||||||
MainWindow_SZNotInstalled,
|
|
||||||
WorkerUI_BadBackupPath,
|
WorkerUI_BadBackupPath,
|
||||||
WorkerUI_BadRestorePath,
|
WorkerUI_BadRestorePath,
|
||||||
MainWindow_RestrictedPath,
|
MainWindow_RestrictedPath,
|
||||||
@@ -32,6 +33,11 @@ namespace MicronSync
|
|||||||
NewRegKeyUI_InvalidKey,
|
NewRegKeyUI_InvalidKey,
|
||||||
NewRegKeyUI_PirateKey,
|
NewRegKeyUI_PirateKey,
|
||||||
MainWindow_BadConfigFile,
|
MainWindow_BadConfigFile,
|
||||||
|
MainWindow_BadConfigFile_FromEXE,
|
||||||
|
MainWindow_DirectoryNotFound,
|
||||||
|
Config_BadFile,
|
||||||
|
MainWindow_BadExplorePath,
|
||||||
|
MainWindow_EmptyExplorePath,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,10 +53,6 @@ namespace MicronSync
|
|||||||
MessageBox.Show("This is a sample error message", "Sample Error Message",
|
MessageBox.Show("This is a sample error message", "Sample Error Message",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
break;
|
break;
|
||||||
case errCodes.MainWindow_SZNotInstalled:
|
|
||||||
MessageBox.Show("7-Zip is not currently installed but is required for MicronSync to run.", "MicronSync",
|
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
|
||||||
break;
|
|
||||||
case errCodes.WorkerUI_BadBackupPath:
|
case errCodes.WorkerUI_BadBackupPath:
|
||||||
MessageBox.Show("The specified source path is inaccessible. Please ensure the path exists and you have read/write permission, then try again.", "MicronSync",
|
MessageBox.Show("The specified source path is inaccessible. Please ensure the path exists and you have read/write permission, then try again.", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
@@ -68,7 +70,7 @@ namespace MicronSync
|
|||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
break;
|
break;
|
||||||
case errCodes.MainWindow_DstWithinSrc:
|
case errCodes.MainWindow_DstWithinSrc:
|
||||||
MessageBox.Show($"Your destination and source paths cannot be within one-another. Please enter valid paths and try again.", "MicronSync",
|
MessageBox.Show($"You cannot create a backup inside of the folder you're tying to backup. Please enter a valid path and try again.", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
break;
|
break;
|
||||||
case errCodes.MainWindow_RestoreError:
|
case errCodes.MainWindow_RestoreError:
|
||||||
@@ -91,16 +93,36 @@ namespace MicronSync
|
|||||||
MessageBox.Show($"The backup file specified does not exist.", "MicronSync",
|
MessageBox.Show($"The backup file specified does not exist.", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
break;
|
break;
|
||||||
|
case errCodes.MainWindow_DirectoryNotFound:
|
||||||
|
MessageBox.Show($"The backup directory specified does not exist.", "MicronSync",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
break;
|
||||||
case errCodes.NewRegKeyUI_InvalidKey:
|
case errCodes.NewRegKeyUI_InvalidKey:
|
||||||
MessageBox.Show($"The key you have entered is invalid. Please ensure you have typed it in the correct format.", "MicronSync",
|
MessageBox.Show($"The key you have entered is invalid. Please ensure you have typed it in the correct format.", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
break;
|
break;
|
||||||
case errCodes.NewRegKeyUI_PirateKey:
|
case errCodes.NewRegKeyUI_PirateKey:
|
||||||
MessageBox.Show($"You have imported a bad key onto your system. Please delete it to continue using this software.", "MicronSync",
|
MessageBox.Show($"You have imported a bad key onto your system. It will now be deleted for the continued use of this software.", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
break;
|
break;
|
||||||
case errCodes.MainWindow_BadConfigFile:
|
case errCodes.MainWindow_BadConfigFile:
|
||||||
MessageBox.Show($"Unable to load configuration, unsupported file.", "MicronSync",
|
MessageBox.Show($"Unsupported data.\nPlease only drop configs, directories or 7-Zip files!", "MicronSync",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
break;
|
||||||
|
case errCodes.MainWindow_BadConfigFile_FromEXE:
|
||||||
|
MessageBox.Show($"Unsupported data.\nOnly config files are supported when loaded directly from application!", "MicronSync",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
break;
|
||||||
|
case errCodes.Config_BadFile:
|
||||||
|
MessageBox.Show($"The following configuration file is corrupt or invalid:\n\n{info}", "MicronSync",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
break;
|
||||||
|
case errCodes.MainWindow_BadExplorePath:
|
||||||
|
MessageBox.Show($"The following path could not be found:\n\n{info}", "MicronSync",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
break;
|
||||||
|
case errCodes.MainWindow_EmptyExplorePath:
|
||||||
|
MessageBox.Show($"Cannot browse to an empty path.", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -136,8 +158,16 @@ namespace MicronSync
|
|||||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
break;
|
break;
|
||||||
case msgCodes.MainWindow_SaveChanges:
|
case msgCodes.MainWindow_SaveChanges:
|
||||||
_dialogResult = MessageBox.Show($"Save changes to file before exiting?\n{info}", "MicronSync",
|
_dialogResult = MessageBox.Show($"There are currently unsaved changes, would you like to save before exiting?\n\n{info}", "MicronSync",
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||||
|
break;
|
||||||
|
case msgCodes.MainWindow_LoadIncompatible:
|
||||||
|
_dialogResult = MessageBox.Show($"You are trying load a legacy config file (v{info}) which is incompatible with this version of MicronSync.\nPlease load a config file which is at least of version 1.2.0.0 or create a new one, sorry for any inconvenience caused!", "MicronSync - Incompatible config",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
break;
|
||||||
|
case msgCodes.MainWindow_SZNotInstalled:
|
||||||
|
_dialogResult = MessageBox.Show("7-Zip is not currently installed but is required for MicronSync to run. Would you like to be taken to the download page?", "MicronSync",
|
||||||
|
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return _dialogResult;
|
return _dialogResult;
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace MicronSync.Components
|
||||||
|
{
|
||||||
|
public class SimplerAES
|
||||||
|
{
|
||||||
|
//private static byte[] key = { 123, 217, 19, 11, 24, 26, 85, 45, 114, 184, 27, 162, 37, 112, 222, 209, 241, 24, 175, 144, 173, 53, 196, 29, 24, 26, 17, 218, 131, 236, 53, 209 };
|
||||||
|
private static byte[] vector = { 124, 134, 176, 172, 17, 45, 121, 41, 250, 61, 14, 213, 50, 136, 255, 236 };
|
||||||
|
private ICryptoTransform encryptor, decryptor;
|
||||||
|
private UTF8Encoding encoder;
|
||||||
|
|
||||||
|
public SimplerAES(byte[] key)
|
||||||
|
{
|
||||||
|
RijndaelManaged rm = new RijndaelManaged();
|
||||||
|
encryptor = rm.CreateEncryptor(key, vector);
|
||||||
|
decryptor = rm.CreateDecryptor(key, vector);
|
||||||
|
encoder = new UTF8Encoding();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Encrypt(string unencrypted)
|
||||||
|
{
|
||||||
|
return Convert.ToBase64String(Encrypt(encoder.GetBytes(unencrypted)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Decrypt(string encrypted)
|
||||||
|
{
|
||||||
|
return encoder.GetString(Decrypt(Convert.FromBase64String(encrypted)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] Encrypt(byte[] buffer)
|
||||||
|
{
|
||||||
|
return Transform(buffer, encryptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] Decrypt(byte[] buffer)
|
||||||
|
{
|
||||||
|
return Transform(buffer, decryptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected byte[] Transform(byte[] buffer, ICryptoTransform transform)
|
||||||
|
{
|
||||||
|
MemoryStream stream = new MemoryStream();
|
||||||
|
using (CryptoStream cs = new CryptoStream(stream, transform, CryptoStreamMode.Write))
|
||||||
|
{
|
||||||
|
cs.Write(buffer, 0, buffer.Length);
|
||||||
|
}
|
||||||
|
return stream.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Generated
+632
-153
File diff suppressed because it is too large
Load Diff
+780
-200
File diff suppressed because it is too large
Load Diff
+277
-25
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
@@ -7,8 +9,29 @@ namespace MicronSync
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Settings to store.
|
/// Settings to store.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Values
|
[Obfuscation(Exclude =true, ApplyToMembers = true)]
|
||||||
|
public class Values : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Flags value to be included in configuration.
|
||||||
|
/// </summary>
|
||||||
|
internal class SaveToConfigAttribute : Attribute { }
|
||||||
|
CommonIO _CIO = new CommonIO();
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
protected void OnPropertyChanged()
|
||||||
|
{
|
||||||
|
PropertyChangedEventHandler handler = PropertyChanged;
|
||||||
|
userModifiedConfig = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly Dictionary<string, string> SysVars = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
|
{ "%appdata%\\", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" },
|
||||||
|
{ "%localappdata%\\", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" },
|
||||||
|
{ "%userprofile%\\", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\" },
|
||||||
|
};
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public Version MSVersion
|
public Version MSVersion
|
||||||
{
|
{
|
||||||
@@ -19,35 +42,244 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public string Description { get; set; }
|
public string Description
|
||||||
|
{
|
||||||
|
get { return _Description; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_Description = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _Description = "";
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public string BackupSource { get; set; }
|
public bool EnablePurge
|
||||||
|
{
|
||||||
|
get { return _EnablePurge; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_EnablePurge = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private bool _EnablePurge;
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public string BackupDestination { get; set; }
|
public bool EnableBackup
|
||||||
|
{
|
||||||
|
get { return _EnableBackup; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_EnableBackup = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private bool _EnableBackup;
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public string RestoreSource { get; set; }
|
public bool OverwriteBackup
|
||||||
|
{
|
||||||
|
get { return _OverwriteBackup; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_OverwriteBackup = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private bool _OverwriteBackup;
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public string RestoreDestination { get; set; }
|
public int CompressionLevel
|
||||||
|
{
|
||||||
|
get { return _CompressionLevel; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_CompressionLevel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int _CompressionLevel = 4;
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public bool EnablePurge { get; set; }
|
public string RootBackupSource
|
||||||
|
{
|
||||||
|
get { return _RootBackupSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
|
||||||
|
_RootBackupSource = value;
|
||||||
|
|
||||||
|
BackupSource = _CIO.ConvertVariableToPath(_RootBackupSource) + _PathBackupSource;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _RootBackupSource = "";
|
||||||
|
[SaveToConfig]
|
||||||
|
public string PathBackupSource
|
||||||
|
{
|
||||||
|
get { return _PathBackupSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_PathBackupSource = value;
|
||||||
|
BackupSource = _CIO.ConvertVariableToPath(_RootBackupSource) + value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _PathBackupSource = "";
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public bool EnableBackup { get; set; }
|
public string RootBackupDestination
|
||||||
|
{
|
||||||
|
get { return _RootBackupDestination; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_RootBackupDestination = value;
|
||||||
|
|
||||||
|
BackupDestination = _CIO.ConvertVariableToPath(_RootBackupDestination) + _PathBackupDestination;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _RootBackupDestination = "";
|
||||||
|
[SaveToConfig]
|
||||||
|
public string PathBackupDestination
|
||||||
|
{
|
||||||
|
get { return _PathBackupDestination; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_PathBackupDestination = value;
|
||||||
|
|
||||||
|
BackupDestination = _CIO.ConvertVariableToPath(_RootBackupDestination) + value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _PathBackupDestination = "";
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public int CompressionLevel { get; set; } = 4;
|
public string RootRestoreSource
|
||||||
|
{
|
||||||
|
get { return _RootRestoreSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_RootRestoreSource = value;
|
||||||
|
|
||||||
|
RestoreSource = _CIO.ConvertVariableToPath(_RootRestoreSource) + _PathRestoreSource;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _RootRestoreSource = "";
|
||||||
|
[SaveToConfig]
|
||||||
|
public string PathRestoreSource
|
||||||
|
{
|
||||||
|
get { return _PathRestoreSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_PathRestoreSource = value;
|
||||||
|
|
||||||
|
RestoreSource = _CIO.ConvertVariableToPath(_RootRestoreSource) + value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _PathRestoreSource = "";
|
||||||
|
|
||||||
|
[SaveToConfig]
|
||||||
|
public string RootRestoreDestination
|
||||||
|
{
|
||||||
|
get { return _RootRestoreDestination; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_RootRestoreDestination = value;
|
||||||
|
|
||||||
|
RestoreDestination = _CIO.ConvertVariableToPath(_RootRestoreDestination) + _PathRestoreDestination;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _RootRestoreDestination = "";
|
||||||
|
[SaveToConfig]
|
||||||
|
public string PathRestoreDestination
|
||||||
|
{
|
||||||
|
get { return _PathRestoreDestination; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_PathRestoreDestination = value;
|
||||||
|
RestoreDestination = _CIO.ConvertVariableToPath(_RootRestoreDestination) + value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _PathRestoreDestination = "";
|
||||||
|
|
||||||
|
[SaveToConfig]
|
||||||
|
public bool InBackupMode
|
||||||
|
{
|
||||||
|
get { return _InBackupMode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_InBackupMode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private bool _InBackupMode = true;
|
||||||
|
|
||||||
|
[SaveToConfig]
|
||||||
|
public int WindowWidth
|
||||||
|
{
|
||||||
|
get { return _WindowWidth; }
|
||||||
|
set { _WindowWidth = value; }
|
||||||
|
}
|
||||||
|
private int _WindowWidth;
|
||||||
|
|
||||||
|
#region Temporary Values
|
||||||
|
|
||||||
|
public string BackupSource
|
||||||
|
{
|
||||||
|
get { return _BackupSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_BackupSource = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _BackupSource;
|
||||||
|
|
||||||
|
public string BackupDestination
|
||||||
|
{
|
||||||
|
get { return _BackupDestination; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_BackupDestination = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _BackupDestination;
|
||||||
|
|
||||||
|
public string RestoreSource
|
||||||
|
{
|
||||||
|
get { return _RestoreSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_RestoreSource = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _RestoreSource;
|
||||||
|
|
||||||
|
public string RestoreDestination
|
||||||
|
{
|
||||||
|
get { return _RestoreDestintation; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_RestoreDestintation = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _RestoreDestintation;
|
||||||
|
|
||||||
public string openFile { get; set; }
|
public string openFile { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
public bool userModifiedConfig { get; set; } = false;
|
||||||
/// Flags value to be included in configuration.
|
|
||||||
/// </summary>
|
public Version loadedVersion { get; set; }
|
||||||
internal class SaveToConfigAttribute : Attribute{}
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MSConfig : Values
|
public class MSConfig : Values
|
||||||
@@ -64,13 +296,9 @@ namespace MicronSync
|
|||||||
StreamWriter writer = new StreamWriter(openFile, true);
|
StreamWriter writer = new StreamWriter(openFile, true);
|
||||||
|
|
||||||
foreach (var item in GetType().GetProperties())
|
foreach (var item in GetType().GetProperties())
|
||||||
{
|
|
||||||
foreach (var attr in item.GetCustomAttributes(true))
|
foreach (var attr in item.GetCustomAttributes(true))
|
||||||
{
|
|
||||||
if (item.GetValue(this) != null && item.CanRead)
|
if (item.GetValue(this) != null && item.CanRead)
|
||||||
writer.WriteLine(String.Format("{0}={1}",item.Name,item.GetValue(this)));
|
writer.WriteLine($"{item.Name}={item.GetValue(this)}");
|
||||||
}
|
|
||||||
}
|
|
||||||
writer.Close();
|
writer.Close();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
@@ -79,35 +307,39 @@ namespace MicronSync
|
|||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userModifiedConfig = false;
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Load()
|
public int Load()
|
||||||
{
|
{
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
|
bool validConfigFile = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var item in GetType().GetProperties())
|
foreach (var item in GetType().GetProperties())
|
||||||
{
|
|
||||||
foreach (var attr in item.GetCustomAttributes(true))
|
foreach (var attr in item.GetCustomAttributes(true))
|
||||||
{
|
{
|
||||||
///
|
|
||||||
string line;
|
string line;
|
||||||
using (StreamReader reader = new StreamReader(openFile, true))
|
using (StreamReader reader = new StreamReader(openFile, true))
|
||||||
{
|
|
||||||
while (!string.IsNullOrEmpty(
|
while (!string.IsNullOrEmpty(
|
||||||
line = reader.ReadLine()))
|
line = reader.ReadLine()))
|
||||||
{
|
{
|
||||||
if (line.StartsWith(item.Name) && item.CanWrite)
|
if (line.StartsWith(item.Name) && item.CanWrite) // Update all values applicable for config file writing.
|
||||||
{
|
{
|
||||||
string readValue = line.ToString().Replace(item.Name, "").TrimStart('=');
|
string readValue = line.ToString().Replace(item.Name, "").TrimStart('=');
|
||||||
item.SetValue(this, Convert.ChangeType(readValue, item.PropertyType));
|
item.SetValue(this, Convert.ChangeType(readValue, item.PropertyType));
|
||||||
}
|
}
|
||||||
|
else if (line.StartsWith("MSVersion")) // Check the config file version is acceptible.
|
||||||
|
{
|
||||||
|
Version readValue = null;
|
||||||
|
if (Version.TryParse(line.ToString().Replace(item.Name, "").TrimStart('='), out readValue))
|
||||||
|
errors += CheckConfigVersion(readValue);
|
||||||
|
|
||||||
|
validConfigFile = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
///
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -115,6 +347,26 @@ namespace MicronSync
|
|||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check config file is valid before continuing
|
||||||
|
if (!validConfigFile)
|
||||||
|
{
|
||||||
|
MessageHandler.errorMessage(MessageHandler.errCodes.Config_BadFile, openFile);
|
||||||
|
errors++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int CheckConfigVersion(Version readValue)
|
||||||
|
{
|
||||||
|
int errors = 0;
|
||||||
|
Version minValue = new Version(1, 2, 0, 0);
|
||||||
|
if (readValue < minValue)
|
||||||
|
{
|
||||||
|
MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_LoadIncompatible, readValue.ToString());
|
||||||
|
errors++;
|
||||||
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,34 +92,53 @@
|
|||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Components\AboutBox.cs">
|
<Compile Include="Components\Forms\AboutBox.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\AboutBox.Designer.cs">
|
<Compile Include="Components\Forms\AboutBox.Designer.cs">
|
||||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\CommonIO.cs" />
|
<Compile Include="Components\Forms\ChangeLog.cs">
|
||||||
<Compile Include="Components\DonationUI.cs">
|
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\DonationUI.Designer.cs">
|
<Compile Include="Components\Forms\ChangeLog.Designer.cs">
|
||||||
|
<DependentUpon>ChangeLog.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Components\CommonIO.cs" />
|
||||||
|
<Compile Include="Components\Forms\DirSizeCalculatorPrompt.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Components\Forms\DirSizeCalculatorPrompt.Designer.cs">
|
||||||
|
<DependentUpon>DirSizeCalculatorPrompt.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Components\Forms\DonationUI.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Components\Forms\DonationUI.Designer.cs">
|
||||||
<DependentUpon>DonationUI.cs</DependentUpon>
|
<DependentUpon>DonationUI.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Components\Forms\DropUI.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Components\Forms\DropUI.Designer.cs">
|
||||||
|
<DependentUpon>DropUI.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Components\Licencer.cs" />
|
<Compile Include="Components\Licencer.cs" />
|
||||||
<Compile Include="Components\LMZAParser.cs" />
|
<Compile Include="Components\LMZAParser.cs" />
|
||||||
<Compile Include="Components\MessageHandler.cs" />
|
<Compile Include="Components\MessageHandler.cs" />
|
||||||
<Compile Include="Components\NewRegKeyUI.cs">
|
<Compile Include="Components\Forms\NewRegKeyUI.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\NewRegKeyUI.Designer.cs">
|
<Compile Include="Components\Forms\NewRegKeyUI.Designer.cs">
|
||||||
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\WorkerUI.cs">
|
<Compile Include="Components\Forms\WorkerUI.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\WorkerUI.Designer.cs">
|
<Compile Include="Components\Forms\WorkerUI.Designer.cs">
|
||||||
<DependentUpon>WorkerUI.cs</DependentUpon>
|
<DependentUpon>WorkerUI.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Components\SimplerAES.cs" />
|
||||||
<Compile Include="MainWindow.cs">
|
<Compile Include="MainWindow.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -127,18 +146,32 @@
|
|||||||
<DependentUpon>MainWindow.cs</DependentUpon>
|
<DependentUpon>MainWindow.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ManageCfg.cs" />
|
<Compile Include="ManageCfg.cs" />
|
||||||
|
<Compile Include="Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Startup.cs" />
|
<Compile Include="Startup.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<EmbeddedResource Include="Components\AboutBox.resx">
|
<EmbeddedResource Include="Components\Forms\AboutBox.resx">
|
||||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Components\DonationUI.resx">
|
<EmbeddedResource Include="Components\Forms\ChangeLog.resx">
|
||||||
|
<DependentUpon>ChangeLog.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Components\Forms\DirSizeCalculatorPrompt.resx">
|
||||||
|
<DependentUpon>DirSizeCalculatorPrompt.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Components\Forms\DonationUI.resx">
|
||||||
<DependentUpon>DonationUI.cs</DependentUpon>
|
<DependentUpon>DonationUI.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Components\NewRegKeyUI.resx">
|
<EmbeddedResource Include="Components\Forms\DropUI.resx">
|
||||||
|
<DependentUpon>DropUI.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Components\Forms\NewRegKeyUI.resx">
|
||||||
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Components\WorkerUI.resx">
|
<EmbeddedResource Include="Components\Forms\WorkerUI.resx">
|
||||||
<DependentUpon>WorkerUI.cs</DependentUpon>
|
<DependentUpon>WorkerUI.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="MainWindow.resx">
|
<EmbeddedResource Include="MainWindow.resx">
|
||||||
@@ -154,6 +187,7 @@
|
|||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="app.manifest">
|
<None Include="app.manifest">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</None>
|
</None>
|
||||||
@@ -169,7 +203,12 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Components\Forms\ChangeLog.txt" />
|
||||||
<Content Include="MicronSync.ico" />
|
<Content Include="MicronSync.ico" />
|
||||||
|
<None Include="Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
<None Include="SKGL.dll" />
|
<None Include="SKGL.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
|
<StartArguments>
|
||||||
|
</StartArguments>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.3.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.3.0.0")]
|
||||||
[assembly: NeutralResourcesLanguage("en-GB")]
|
[assembly: NeutralResourcesLanguage("en-GB")]
|
||||||
|
|
||||||
|
|||||||
Generated
+78
@@ -0,0 +1,78 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace MicronSync {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||||
|
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||||
|
public bool UseDarkTheme {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["UseDarkTheme"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UseDarkTheme"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
|
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||||
|
public string UserLicenseKey {
|
||||||
|
get {
|
||||||
|
return ((string)(this["UserLicenseKey"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UserLicenseKey"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
|
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||||
|
public string UserMAC {
|
||||||
|
get {
|
||||||
|
return ((string)(this["UserMAC"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UserMAC"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
|
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||||
|
public string UserName {
|
||||||
|
get {
|
||||||
|
return ((string)(this["UserName"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UserName"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MicronSync" GeneratedClassName="Settings">
|
||||||
|
<Profiles />
|
||||||
|
<Settings>
|
||||||
|
<Setting Name="UseDarkTheme" Roaming="true" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">False</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="UserLicenseKey" Roaming="true" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
</Settings>
|
||||||
|
</SettingsFile>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<section name="MicronSync.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<userSettings>
|
||||||
|
<MicronSync.Settings>
|
||||||
|
<setting name="UseDarkTheme" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="UserLicenseKey" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</MicronSync.Settings>
|
||||||
|
</userSettings>
|
||||||
|
</configuration>
|
||||||
Binary file not shown.
@@ -1,6 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<configSections>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
</startup>
|
<section name="MicronSync.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<userSettings>
|
||||||
|
<MicronSync.Settings>
|
||||||
|
<setting name="UseDarkTheme" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="UserLicenseKey" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</MicronSync.Settings>
|
||||||
|
</userSettings>
|
||||||
</configuration>
|
</configuration>
|
||||||
Binary file not shown.
@@ -1,6 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<configSections>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
</startup>
|
<section name="MicronSync.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<userSettings>
|
||||||
|
<MicronSync.Settings>
|
||||||
|
<setting name="UseDarkTheme" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="UserLicenseKey" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</MicronSync.Settings>
|
||||||
|
</userSettings>
|
||||||
</configuration>
|
</configuration>
|
||||||
Binary file not shown.
Reference in New Issue
Block a user