Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cea242a17 | |||
| 65acd57b40 | |||
| 7e7fe3881e |
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace MicronSync
|
||||
{
|
||||
@@ -8,28 +9,10 @@ namespace MicronSync
|
||||
/// </summary>
|
||||
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 }
|
||||
|
||||
#region Filesystem
|
||||
|
||||
public string SaveFile(string originalPath, FileType f)
|
||||
{
|
||||
var file = new System.Windows.Forms.SaveFileDialog();
|
||||
@@ -88,22 +71,45 @@ namespace MicronSync
|
||||
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)
|
||||
{
|
||||
string result = null;
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(dir))
|
||||
result = string.Format("{0} - {1}",
|
||||
Directory.GetLastWriteTime(dir).ToShortDateString(),
|
||||
Directory.GetLastWriteTime(dir).ToLongTimeString());
|
||||
else
|
||||
result = "N/A";
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -111,23 +117,68 @@ namespace MicronSync
|
||||
public string CalculateFileModifyDate(string file)
|
||||
{
|
||||
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;
|
||||
}
|
||||
catch (System.Exception)
|
||||
|
||||
public string GetRootPath(string input)
|
||||
{
|
||||
throw;
|
||||
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 (input.StartsWith(@"\\"))
|
||||
result = unc.Value;
|
||||
else
|
||||
result = drive.Value;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
public enum endResult
|
||||
@@ -135,7 +186,7 @@ namespace MicronSync
|
||||
ClearEntireDirectory_Error,
|
||||
CopyEntireDirectory_Error,
|
||||
Default,
|
||||
FileNotExist,
|
||||
RenameEntireDirectory_Error,
|
||||
}
|
||||
|
||||
public endResult ClearEntireDirectory(string dir)
|
||||
@@ -167,6 +218,23 @@ namespace MicronSync
|
||||
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)
|
||||
{
|
||||
endResult _endResult = endResult.Default;
|
||||
@@ -187,19 +255,14 @@ namespace MicronSync
|
||||
// Copy all files to destination.
|
||||
FileInfo[] files = dir.GetFiles();
|
||||
foreach (FileInfo file in files)
|
||||
{
|
||||
File.Copy(Path.Combine(src, file.Name),
|
||||
Path.Combine(dst, file.Name));
|
||||
}
|
||||
|
||||
// Repeat for subdirectories.
|
||||
foreach (DirectoryInfo subDir in dirs)
|
||||
{
|
||||
CopyEntireDirectory(subDir.FullName,
|
||||
Path.Combine(dst, subDir.Name));
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_endResult = endResult.CopyEntireDirectory_Error;
|
||||
@@ -210,9 +273,15 @@ namespace MicronSync
|
||||
|
||||
#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">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wwAADsMBx2+oZAAAEWdJREFUeF7tnVlsVNcZx71gGy9gj7eZsT2e3UCI2QwY2zhgwmZWb0ASGkgDhKSQ
|
||||
wgAADsIBFShKgAAAEWdJREFUeF7tnVlsVNcZx71gGy9gj7eZsT2e3UCI2QwY2zhgwmZWb0ASGkgDhKSQ
|
||||
EDAEUUQTGkKCCJCUEiBsYYmqPlVRFVVVVVVVVUVVVEWoqqI+5KEPVVRVURWhKKoidPv9L3OGc6/PeO42
|
||||
dyae8/CTrHs8Z/v+33fPOffccwsURSmU5C9SAHmOFECeIwWQ50gB5DlSAHmOIQEUFBQUc5R8DynTUZ4C
|
||||
/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 &&
|
||||
!timerStopped)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
Thread.Sleep(250);
|
||||
position += stepAmount;
|
||||
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "WorkerUI";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "MicronSync";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WorkerUI_FormClosing);
|
||||
this.Load += new System.EventHandler(this.WorkerUI_Load);
|
||||
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MicronSync.Components
|
||||
@@ -21,7 +17,9 @@ namespace MicronSync.Components
|
||||
}
|
||||
public LMZAParser.endResult _endResultLMZA = LMZAParser.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()
|
||||
{
|
||||
@@ -43,10 +41,10 @@ namespace MicronSync.Components
|
||||
private void LmzaBackup_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
_endResultLMZA = lmzaParser.MakePackage(
|
||||
Path.GetFileName(_ManageConfig_RO.BackupDestination),
|
||||
_ManageConfig_RO.BackupSource,
|
||||
Path.GetDirectoryName(_ManageConfig_RO.BackupDestination),
|
||||
_ManageConfig_RO.CompressionLevel,
|
||||
Path.GetFileName(_MSConfig.BackupDestination),
|
||||
_MSConfig.BackupSource,
|
||||
Path.GetDirectoryName(_MSConfig.BackupDestination),
|
||||
_MSConfig.CompressionLevel,
|
||||
"",
|
||||
false);
|
||||
}
|
||||
@@ -58,46 +56,57 @@ namespace MicronSync.Components
|
||||
}
|
||||
|
||||
private void LmzaRestore_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
// Only continue if file exists!
|
||||
bool fileExists = false;
|
||||
if (File.Exists(_ManageConfig_RO.RestoreSource))
|
||||
fileExists = true;
|
||||
else
|
||||
_endResultCIO = CommonIO.endResult.FileNotExist;
|
||||
|
||||
// Only continue if above is true.
|
||||
if (fileExists)
|
||||
{
|
||||
// Process params.
|
||||
using (CommonIO cio = new CommonIO())
|
||||
{
|
||||
if (_ManageConfig_RO.EnableBackup)
|
||||
var restoreBackupDir = _MSConfig.RestoreDestination + ".Backup";
|
||||
|
||||
// Clear out old backup directory if it exists.
|
||||
if (_MSConfig.OverwriteBackup && Directory.Exists(restoreBackupDir))
|
||||
{
|
||||
_endResultCIO = cio.CopyEntireDirectory(_ManageConfig_RO.RestoreDestination,
|
||||
_ManageConfig_RO.RestoreDestination + ".Backup");
|
||||
Directory.Delete(restoreBackupDir, true);
|
||||
Thread.Sleep(500); // Delay needed for reliability!
|
||||
}
|
||||
if (_ManageConfig_RO.EnablePurge)
|
||||
_endResultCIO = cio.ClearEntireDirectory(_ManageConfig_RO.RestoreDestination);
|
||||
|
||||
// Move source directory if also purging, otherwise perform standard copy.
|
||||
if (_MSConfig.EnableBackup && !_MSConfig.EnablePurge)
|
||||
{
|
||||
_endResultCIO = cio.CopyEntireDirectory(
|
||||
_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(_ManageConfig_RO.RestoreSource),
|
||||
Path.GetDirectoryName(_ManageConfig_RO.RestoreSource),
|
||||
_ManageConfig_RO.RestoreDestination,
|
||||
Path.GetFileName(_MSConfig.RestoreSource),
|
||||
Path.GetDirectoryName(_MSConfig.RestoreSource),
|
||||
_MSConfig.RestoreDestination,
|
||||
"");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Form Functionality
|
||||
|
||||
private bool canClose = false;
|
||||
private bool canClose;
|
||||
|
||||
private void WorkerUI_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Start stopwatch.
|
||||
stopWatch.Start();
|
||||
|
||||
switch (SetWorkerMode)
|
||||
{
|
||||
case WorkerMode.Backup:
|
||||
@@ -120,6 +129,13 @@ namespace MicronSync.Components
|
||||
|
||||
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)
|
||||
e.Cancel = true;
|
||||
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 System;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
public class Licencer
|
||||
{
|
||||
private readonly string privateKey = "TRZzjAutdtA542aeQj";
|
||||
private readonly string msRegPath = @"SOFTWARE\MicronSync\";
|
||||
private readonly string msRegKey = "Key";
|
||||
private static SimplerAES aes = new SimplerAES(Encoding.ASCII.GetBytes(GetMachineGUID()));
|
||||
public static bool isRegistered { get; set; } = false;
|
||||
|
||||
public bool CheckForExistingLicence()
|
||||
{
|
||||
bool licenceExists = false;
|
||||
bool isValidKey = false;
|
||||
|
||||
try
|
||||
{
|
||||
var regPath = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
|
||||
var regKey = regPath?.OpenSubKey(msRegPath);
|
||||
var value = regKey?.GetValue(msRegKey);
|
||||
|
||||
bool isValidKey = ValidateKey((string)value);
|
||||
|
||||
if (isValidKey)
|
||||
{
|
||||
licenceExists = true;
|
||||
isValidKey = ValidateKey(
|
||||
aes.Decrypt(Settings.Default.UserLicenseKey));
|
||||
}
|
||||
else if (regKey != null && !isValidKey)
|
||||
catch (Exception) { isValidKey = false; }
|
||||
|
||||
if (isValidKey == false && Settings.Default.UserLicenseKey != string.Empty)
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
|
||||
Environment.Exit(2);
|
||||
Settings.Default.UserLicenseKey = string.Empty;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
licenceExists = false;
|
||||
}
|
||||
|
||||
return licenceExists;
|
||||
return isValidKey;
|
||||
}
|
||||
|
||||
public void ShowDonationPrompt()
|
||||
@@ -47,6 +38,18 @@ namespace MicronSync.Components
|
||||
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>
|
||||
/// Returns legitimacy of key.
|
||||
/// </summary>
|
||||
@@ -62,21 +65,13 @@ namespace MicronSync.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores key into user level registry.
|
||||
/// Stores key into user level AppData.
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
public void SetKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
var regPath = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
|
||||
var regKey = regPath.CreateSubKey(msRegPath);
|
||||
regKey.SetValue(msRegKey, key.ToUpper(), RegistryValueKind.String);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
Settings.Default.UserLicenseKey = aes.Encrypt(key);
|
||||
Settings.Default.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,12 +13,13 @@ namespace MicronSync
|
||||
MainWindow_Warn_OverwriteFile,
|
||||
NewRegKeyUI_CorrectKey,
|
||||
MainWindow_SaveChanges,
|
||||
MainWindow_LoadIncompatible,
|
||||
MainWindow_SZNotInstalled,
|
||||
}
|
||||
|
||||
public enum errCodes
|
||||
{
|
||||
_TestSample,
|
||||
MainWindow_SZNotInstalled,
|
||||
WorkerUI_BadBackupPath,
|
||||
WorkerUI_BadRestorePath,
|
||||
MainWindow_RestrictedPath,
|
||||
@@ -32,6 +33,11 @@ namespace MicronSync
|
||||
NewRegKeyUI_InvalidKey,
|
||||
NewRegKeyUI_PirateKey,
|
||||
MainWindow_BadConfigFile,
|
||||
MainWindow_BadConfigFile_FromEXE,
|
||||
MainWindow_DirectoryNotFound,
|
||||
Config_BadFile,
|
||||
MainWindow_BadExplorePath,
|
||||
MainWindow_EmptyExplorePath,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -47,10 +53,6 @@ namespace MicronSync
|
||||
MessageBox.Show("This is a sample error message", "Sample Error Message",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
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:
|
||||
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);
|
||||
@@ -68,7 +70,7 @@ namespace MicronSync
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
case errCodes.MainWindow_RestoreError:
|
||||
@@ -91,16 +93,36 @@ namespace MicronSync
|
||||
MessageBox.Show($"The backup file specified does not exist.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
case errCodes.MainWindow_DirectoryNotFound:
|
||||
MessageBox.Show($"The backup directory specified does not exist.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
case errCodes.NewRegKeyUI_InvalidKey:
|
||||
MessageBox.Show($"The key you have entered is invalid. Please ensure you have typed it in the correct format.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
}
|
||||
@@ -136,8 +158,16 @@ namespace MicronSync
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
break;
|
||||
case msgCodes.MainWindow_SaveChanges:
|
||||
_dialogResult = MessageBox.Show($"Save changes to file before exiting?\n{info}", "MicronSync",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
_dialogResult = MessageBox.Show($"There are currently unsaved changes, would you like to save before exiting?\n\n{info}", "MicronSync",
|
||||
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;
|
||||
}
|
||||
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
+736
-156
File diff suppressed because it is too large
Load Diff
+276
-24
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
@@ -7,8 +9,29 @@ namespace MicronSync
|
||||
/// <summary>
|
||||
/// Settings to store.
|
||||
/// </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]
|
||||
public Version MSVersion
|
||||
{
|
||||
@@ -19,35 +42,244 @@ namespace MicronSync
|
||||
}
|
||||
|
||||
[SaveToConfig]
|
||||
public string Description { get; set; }
|
||||
public string Description
|
||||
{
|
||||
get { return _Description; }
|
||||
set
|
||||
{
|
||||
_Description = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _Description = "";
|
||||
|
||||
[SaveToConfig]
|
||||
public string BackupSource { get; set; }
|
||||
public bool EnablePurge
|
||||
{
|
||||
get { return _EnablePurge; }
|
||||
set
|
||||
{
|
||||
_EnablePurge = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private bool _EnablePurge;
|
||||
|
||||
[SaveToConfig]
|
||||
public string BackupDestination { get; set; }
|
||||
public bool EnableBackup
|
||||
{
|
||||
get { return _EnableBackup; }
|
||||
set
|
||||
{
|
||||
_EnableBackup = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private bool _EnableBackup;
|
||||
|
||||
[SaveToConfig]
|
||||
public string RestoreSource { get; set; }
|
||||
public bool OverwriteBackup
|
||||
{
|
||||
get { return _OverwriteBackup; }
|
||||
set
|
||||
{
|
||||
_OverwriteBackup = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private bool _OverwriteBackup;
|
||||
|
||||
[SaveToConfig]
|
||||
public string RestoreDestination { get; set; }
|
||||
public int CompressionLevel
|
||||
{
|
||||
get { return _CompressionLevel; }
|
||||
set
|
||||
{
|
||||
_CompressionLevel = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private int _CompressionLevel = 4;
|
||||
|
||||
[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]
|
||||
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]
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// Flags value to be included in configuration.
|
||||
/// </summary>
|
||||
internal class SaveToConfigAttribute : Attribute{}
|
||||
public bool userModifiedConfig { get; set; } = false;
|
||||
|
||||
public Version loadedVersion { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class MSConfig : Values
|
||||
@@ -64,13 +296,9 @@ namespace MicronSync
|
||||
StreamWriter writer = new StreamWriter(openFile, true);
|
||||
|
||||
foreach (var item in GetType().GetProperties())
|
||||
{
|
||||
foreach (var attr in item.GetCustomAttributes(true))
|
||||
{
|
||||
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();
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -79,34 +307,38 @@ namespace MicronSync
|
||||
errors++;
|
||||
}
|
||||
|
||||
userModifiedConfig = false;
|
||||
return errors;
|
||||
}
|
||||
|
||||
public int Load()
|
||||
{
|
||||
int errors = 0;
|
||||
bool validConfigFile = false;
|
||||
try
|
||||
{
|
||||
foreach (var item in GetType().GetProperties())
|
||||
{
|
||||
foreach (var attr in item.GetCustomAttributes(true))
|
||||
{
|
||||
///
|
||||
string line;
|
||||
using (StreamReader reader = new StreamReader(openFile, true))
|
||||
{
|
||||
while (!string.IsNullOrEmpty(
|
||||
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('=');
|
||||
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)
|
||||
@@ -115,6 +347,26 @@ namespace MicronSync
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,34 +92,53 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Components\AboutBox.cs">
|
||||
<Compile Include="Components\Forms\AboutBox.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\AboutBox.Designer.cs">
|
||||
<Compile Include="Components\Forms\AboutBox.Designer.cs">
|
||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\CommonIO.cs" />
|
||||
<Compile Include="Components\DonationUI.cs">
|
||||
<Compile Include="Components\Forms\ChangeLog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</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>
|
||||
</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\LMZAParser.cs" />
|
||||
<Compile Include="Components\MessageHandler.cs" />
|
||||
<Compile Include="Components\NewRegKeyUI.cs">
|
||||
<Compile Include="Components\Forms\NewRegKeyUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\NewRegKeyUI.Designer.cs">
|
||||
<Compile Include="Components\Forms\NewRegKeyUI.Designer.cs">
|
||||
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\WorkerUI.cs">
|
||||
<Compile Include="Components\Forms\WorkerUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\WorkerUI.Designer.cs">
|
||||
<Compile Include="Components\Forms\WorkerUI.Designer.cs">
|
||||
<DependentUpon>WorkerUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\SimplerAES.cs" />
|
||||
<Compile Include="MainWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -127,18 +146,32 @@
|
||||
<DependentUpon>MainWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<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="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Components\AboutBox.resx">
|
||||
<EmbeddedResource Include="Components\Forms\AboutBox.resx">
|
||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||
</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>
|
||||
</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>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Components\WorkerUI.resx">
|
||||
<EmbeddedResource Include="Components\Forms\WorkerUI.resx">
|
||||
<DependentUpon>WorkerUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainWindow.resx">
|
||||
@@ -154,6 +187,7 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="app.manifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@@ -169,7 +203,12 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Components\Forms\ChangeLog.txt" />
|
||||
<Content Include="MicronSync.ico" />
|
||||
<None Include="Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="SKGL.dll" />
|
||||
</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
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.3.0.0")]
|
||||
[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" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<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" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<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.
Reference in New Issue
Block a user