Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cea242a17 | |||
| 65acd57b40 |
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace MicronSync
|
namespace MicronSync
|
||||||
{
|
{
|
||||||
@@ -90,6 +91,12 @@ namespace MicronSync
|
|||||||
return newPath;
|
return newPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double CalculateFileSizeMB (string file)
|
||||||
|
{
|
||||||
|
FileInfo fi = new FileInfo(file);
|
||||||
|
return ConvertBytesToMB(fi.Length);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region String manipulation
|
#region String manipulation
|
||||||
@@ -120,6 +127,56 @@ namespace MicronSync
|
|||||||
return result;
|
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 (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.
|
#endregion.
|
||||||
|
|
||||||
#region Filesystem Modification
|
#region Filesystem Modification
|
||||||
@@ -216,6 +273,15 @@ namespace MicronSync
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Conversion
|
||||||
|
|
||||||
|
public double ConvertBytesToMB(double bytes)
|
||||||
|
{
|
||||||
|
return Math.Round(bytes / 1024f / 1024f, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public void Dispose() { GC.Collect(); }
|
public void Dispose() { GC.Collect(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+4
-2
@@ -28,6 +28,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangeLog));
|
||||||
this.richTextBox = new System.Windows.Forms.RichTextBox();
|
this.richTextBox = new System.Windows.Forms.RichTextBox();
|
||||||
this.labelVersionInfo = new System.Windows.Forms.Label();
|
this.labelVersionInfo = new System.Windows.Forms.Label();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
this.richTextBox.Location = new System.Drawing.Point(13, 38);
|
this.richTextBox.Location = new System.Drawing.Point(13, 38);
|
||||||
this.richTextBox.Name = "richTextBox";
|
this.richTextBox.Name = "richTextBox";
|
||||||
this.richTextBox.ReadOnly = true;
|
this.richTextBox.ReadOnly = true;
|
||||||
this.richTextBox.Size = new System.Drawing.Size(359, 361);
|
this.richTextBox.Size = new System.Drawing.Size(679, 360);
|
||||||
this.richTextBox.TabIndex = 0;
|
this.richTextBox.TabIndex = 0;
|
||||||
this.richTextBox.Text = "";
|
this.richTextBox.Text = "";
|
||||||
//
|
//
|
||||||
@@ -59,9 +60,10 @@
|
|||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.BackColor = System.Drawing.Color.White;
|
this.BackColor = System.Drawing.Color.White;
|
||||||
this.ClientSize = new System.Drawing.Size(384, 411);
|
this.ClientSize = new System.Drawing.Size(704, 411);
|
||||||
this.Controls.Add(this.labelVersionInfo);
|
this.Controls.Add(this.labelVersionInfo);
|
||||||
this.Controls.Add(this.richTextBox);
|
this.Controls.Add(this.richTextBox);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.MinimumSize = new System.Drawing.Size(400, 450);
|
this.MinimumSize = new System.Drawing.Size(400, 450);
|
||||||
this.Name = "ChangeLog";
|
this.Name = "ChangeLog";
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,53 @@
|
|||||||
// Comments are denoted at the beginning of a line with two forward slashes.
|
[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]
|
[Bug Fixes]
|
||||||
- Fixed new pre-backup algorithm from placing backup inside of source directory when the path ended with a "\".
|
- Fixed new pre-backup algorithm from placing backup inside of source directory when the path ended with a "\".
|
||||||
|
|
||||||
***[MicronSync 1.1.0.0]***
|
[MicronSync 1.1.0.0]-------------------------------------------------------------------------------
|
||||||
[New Features]
|
[New Features]
|
||||||
- Inclusion of a changelog (the very thing you currently have open!)
|
- Inclusion of a changelog (the very thing you currently have open!)
|
||||||
- Ability to replicate destination and source paths between backup and restore tabs.
|
- Ability to replicate destination and source paths between backup and restore tabs.
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -112,7 +112,7 @@ namespace MicronSync.Components.Forms
|
|||||||
this.btnSzUseBackup.Name = "btnSzUseBackup";
|
this.btnSzUseBackup.Name = "btnSzUseBackup";
|
||||||
this.btnSzUseBackup.Size = new System.Drawing.Size(162, 23);
|
this.btnSzUseBackup.Size = new System.Drawing.Size(162, 23);
|
||||||
this.btnSzUseBackup.TabIndex = 2;
|
this.btnSzUseBackup.TabIndex = 2;
|
||||||
this.btnSzUseBackup.Text = "Overwrite file with new backup";
|
this.btnSzUseBackup.Text = "Replace file with backup";
|
||||||
this.btnSzUseBackup.UseVisualStyleBackColor = true;
|
this.btnSzUseBackup.UseVisualStyleBackColor = true;
|
||||||
this.btnSzUseBackup.Click += new System.EventHandler(this.btnSzUseBackup_Click);
|
this.btnSzUseBackup.Click += new System.EventHandler(this.btnSzUseBackup_Click);
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -62,26 +60,39 @@ namespace MicronSync.Components
|
|||||||
// Process params.
|
// Process params.
|
||||||
using (CommonIO cio = new CommonIO())
|
using (CommonIO cio = new CommonIO())
|
||||||
{
|
{
|
||||||
// Move source directory if also purging, otherwise perform standard copy.
|
var restoreBackupDir = _MSConfig.RestoreDestination + ".Backup";
|
||||||
if (_ManageConfig_RO.EnableBackup && !_ManageConfig_RO.EnablePurge)
|
|
||||||
_endResultCIO = cio.CopyEntireDirectory(_ManageConfig_RO.RestoreDestination,
|
// Clear out old backup directory if it exists.
|
||||||
_ManageConfig_RO.RestoreDestination + ".Backup");
|
if (_MSConfig.OverwriteBackup && Directory.Exists(restoreBackupDir))
|
||||||
else if (_ManageConfig_RO.EnableBackup && _ManageConfig_RO.EnablePurge)
|
|
||||||
{
|
{
|
||||||
_endResultCIO = cio.RenameEntireDirectory(_ManageConfig_RO.RestoreDestination,
|
Directory.Delete(restoreBackupDir, true);
|
||||||
_ManageConfig_RO.RestoreDestination + ".Backup");
|
Thread.Sleep(500); // Delay needed for reliability!
|
||||||
Directory.CreateDirectory(_ManageConfig_RO.RestoreDestination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_ManageConfig_RO.EnablePurge)
|
// Move source directory if also purging, otherwise perform standard copy.
|
||||||
_endResultCIO = cio.ClearEntireDirectory(_ManageConfig_RO.RestoreDestination);
|
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)
|
if (_endResultCIO == CommonIO.endResult.Default)
|
||||||
_endResultLMZA = lmzaParser.ExtractPackage(
|
_endResultLMZA = lmzaParser.ExtractPackage(
|
||||||
Path.GetFileName(_ManageConfig_RO.RestoreSource),
|
Path.GetFileName(_MSConfig.RestoreSource),
|
||||||
Path.GetDirectoryName(_ManageConfig_RO.RestoreSource),
|
Path.GetDirectoryName(_MSConfig.RestoreSource),
|
||||||
_ManageConfig_RO.RestoreDestination,
|
_MSConfig.RestoreDestination,
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +104,9 @@ namespace MicronSync.Components
|
|||||||
|
|
||||||
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:
|
||||||
@@ -115,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
|
||||||
|
|||||||
@@ -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)
|
catch (Exception) { isValidKey = false; }
|
||||||
|
|
||||||
|
if (isValidKey == false && Settings.Default.UserLicenseKey != string.Empty)
|
||||||
{
|
{
|
||||||
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
|
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
|
||||||
Environment.Exit(2);
|
Settings.Default.UserLicenseKey = string.Empty;
|
||||||
|
Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
return isValidKey;
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
licenceExists = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return licenceExists;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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,
|
||||||
@@ -34,6 +35,9 @@ namespace MicronSync
|
|||||||
MainWindow_BadConfigFile,
|
MainWindow_BadConfigFile,
|
||||||
MainWindow_BadConfigFile_FromEXE,
|
MainWindow_BadConfigFile_FromEXE,
|
||||||
MainWindow_DirectoryNotFound,
|
MainWindow_DirectoryNotFound,
|
||||||
|
Config_BadFile,
|
||||||
|
MainWindow_BadExplorePath,
|
||||||
|
MainWindow_EmptyExplorePath,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -49,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);
|
||||||
@@ -102,7 +102,7 @@ namespace 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:
|
||||||
@@ -113,6 +113,18 @@ namespace MicronSync
|
|||||||
MessageBox.Show($"Unsupported data.\nOnly config files are supported when loaded directly from application!", "MicronSync",
|
MessageBox.Show($"Unsupported data.\nOnly config files are supported when loaded directly from application!", "MicronSync",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
break;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -146,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($"There are currently unsaved changes, would you like to save 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
+579
-184
File diff suppressed because it is too large
Load Diff
+535
-76
@@ -6,6 +6,7 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using MicronSync.Components.Forms;
|
using MicronSync.Components.Forms;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
namespace MicronSync
|
namespace MicronSync
|
||||||
{
|
{
|
||||||
@@ -16,6 +17,7 @@ namespace MicronSync
|
|||||||
private readonly CommonIO _CommonIO = new CommonIO();
|
private readonly CommonIO _CommonIO = new CommonIO();
|
||||||
private readonly ParseUserInput _ParseUserInput = new ParseUserInput();
|
private readonly ParseUserInput _ParseUserInput = new ParseUserInput();
|
||||||
private bool isLoading;
|
private bool isLoading;
|
||||||
|
private bool hasCancelledExit;
|
||||||
|
|
||||||
public MainWindow() { InitializeComponent(); }
|
public MainWindow() { InitializeComponent(); }
|
||||||
|
|
||||||
@@ -28,7 +30,9 @@ namespace MicronSync
|
|||||||
|
|
||||||
CreateTooltips();
|
CreateTooltips();
|
||||||
ProcessLicence();
|
ProcessLicence();
|
||||||
|
PopulateRootLists();
|
||||||
ProcessArgs(args);
|
ProcessArgs(args);
|
||||||
|
UseDarkTheme(Settings.Default.UseDarkTheme);
|
||||||
labelDevBuild.Visible = false; // Comment out before releasing.
|
labelDevBuild.Visible = false; // Comment out before releasing.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +76,7 @@ namespace MicronSync
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void CreateTooltips()
|
private void CreateTooltips()
|
||||||
{
|
{
|
||||||
toolTip.AutomaticDelay = 5000;
|
toolTip.AutomaticDelay = 8000;
|
||||||
toolTip.InitialDelay = 1000;
|
toolTip.InitialDelay = 1000;
|
||||||
toolTip.ReshowDelay = 500;
|
toolTip.ReshowDelay = 500;
|
||||||
toolTip.ShowAlways = true;
|
toolTip.ShowAlways = true;
|
||||||
@@ -88,11 +92,56 @@ namespace MicronSync
|
|||||||
toolTip.SetToolTip(chkPurge, "This will COMPLETELY wipe clean the restore destination directory\n" +
|
toolTip.SetToolTip(chkPurge, "This will COMPLETELY wipe clean the restore destination directory\n" +
|
||||||
"prior to restoring from the selected backup.");
|
"prior to restoring from the selected backup.");
|
||||||
toolTip.SetToolTip(chkBackup, "Enabling this option will create a backup of the restoration directory\n" +
|
toolTip.SetToolTip(chkBackup, "Enabling this option will create a backup of the restoration directory\n" +
|
||||||
"with the extension \".Backup\".");
|
"with the extension \".Backup\". This backup will not be updated unless the overwrite option is enabled.");
|
||||||
toolTip.SetToolTip(btnRepBackupSource, "Replicate path to restore destination.");
|
toolTip.SetToolTip(btnRepBackupSource, "Replicate path to restore destination.");
|
||||||
toolTip.SetToolTip(btnRepBackupDest, "Replicate path to restore source.");
|
toolTip.SetToolTip(btnRepBackupDest, "Replicate path to restore source.");
|
||||||
toolTip.SetToolTip(btnRepRestoreSource, "Replicate path to backup destination.");
|
toolTip.SetToolTip(btnRepRestoreSource, "Replicate path to backup destination.");
|
||||||
toolTip.SetToolTip(btnRepRestoreDest, "Replicate path to backup source.");
|
toolTip.SetToolTip(btnRepRestoreDest, "Replicate path to backup source.");
|
||||||
|
toolTip.SetToolTip(labelCompressionPreset, "Selecting a preset to use will automatically choose optimal compression settings.");
|
||||||
|
toolTip.SetToolTip(btnExploreBSource, "Browse to specified directory.");
|
||||||
|
toolTip.SetToolTip(btnExploreRDestination, "Browse to specified directory.");
|
||||||
|
toolTip.SetToolTip(chkOverwriteBackup, "Overwriting your backup will consistently create a previous backup prior to each restore task.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PopulateRootLists()
|
||||||
|
{
|
||||||
|
// Clear existing lists.
|
||||||
|
cmbRootBSrc.Items.Clear();
|
||||||
|
cmbRootBDst.Items.Clear();
|
||||||
|
cmbRootRSrc.Items.Clear();
|
||||||
|
cmbRootRDst.Items.Clear();
|
||||||
|
|
||||||
|
// Add blank header for each of the dropdowns.
|
||||||
|
cmbRootBSrc.Items.Add("");
|
||||||
|
cmbRootBDst.Items.Add("");
|
||||||
|
cmbRootRSrc.Items.Add("");
|
||||||
|
cmbRootRDst.Items.Add("");
|
||||||
|
|
||||||
|
string[] drives = Directory.GetLogicalDrives();
|
||||||
|
foreach (var drive in drives)
|
||||||
|
{
|
||||||
|
cmbRootBSrc.Items.Add(drive);
|
||||||
|
cmbRootBDst.Items.Add(drive);
|
||||||
|
cmbRootRSrc.Items.Add(drive);
|
||||||
|
cmbRootRDst.Items.Add(drive);
|
||||||
|
}
|
||||||
|
foreach (var var in MSConfig.SysVars)
|
||||||
|
{
|
||||||
|
cmbRootBSrc.Items.Add(var.Key);
|
||||||
|
cmbRootBDst.Items.Add(var.Key);
|
||||||
|
cmbRootRSrc.Items.Add(var.Key);
|
||||||
|
cmbRootRDst.Items.Add(var.Key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes registration entry from menu if registered.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isLicenced"></param>
|
||||||
|
private void RemoveRegInfoMenubar(bool isLicenced)
|
||||||
|
{
|
||||||
|
if (isLicenced)
|
||||||
|
menuStrip1.Items.RemoveByKey("registerToolStripMenuItem");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -114,15 +163,20 @@ namespace MicronSync
|
|||||||
if(!string.IsNullOrEmpty(loadedFile))
|
if(!string.IsNullOrEmpty(loadedFile))
|
||||||
if (loadedFile.EndsWith(".ini"))
|
if (loadedFile.EndsWith(".ini"))
|
||||||
{
|
{
|
||||||
_MSConfig = new MSConfig {openFile = loadedFile};
|
_MSConfig = new MSConfig { openFile = loadedFile };
|
||||||
_MSConfig.Load();
|
int result = _MSConfig.Load();
|
||||||
UpdateWithConfig();
|
if (result == 0)
|
||||||
|
{
|
||||||
// Set titlebar name.
|
// Set titlebar name.
|
||||||
UpdateTitlebar = loadedFile;
|
UpTitlebar = loadedFile;
|
||||||
UpdateStatus = "Load successful";
|
UpStatus = "Load successful";
|
||||||
saveToolStripMenuItem.Enabled = true;
|
saveToolStripMenuItem.Enabled = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
_MSConfig = new MSConfig();
|
||||||
|
|
||||||
|
UpdateWithConfig();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (!fromExe)
|
if (!fromExe)
|
||||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile, null);
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile, null);
|
||||||
@@ -130,6 +184,7 @@ namespace MicronSync
|
|||||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile_FromEXE, null);
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile_FromEXE, null);
|
||||||
//
|
//
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
_MSConfig.userModifiedConfig = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -137,17 +192,24 @@ namespace MicronSync
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateWithConfig()
|
private void UpdateWithConfig()
|
||||||
{
|
{
|
||||||
UpdateTitlebar = _MSConfig.openFile;
|
UpTitlebar = _MSConfig.openFile;
|
||||||
textDescription.Text = _MSConfig.Description;
|
textDescription.Text = _MSConfig.Description;
|
||||||
textBackupSource.Text = _MSConfig.BackupSource;
|
UpRootBackupSourceUI = _MSConfig.RootBackupSource;
|
||||||
textBackupDest.Text = _MSConfig.BackupDestination;
|
textBackupSource.Text = _MSConfig.PathBackupSource;
|
||||||
textRestoreSource.Text = _MSConfig.RestoreSource;
|
UpRootBackupDestinationUI = _MSConfig.RootBackupDestination;
|
||||||
textRestoreDest.Text = _MSConfig.RestoreDestination;
|
textBackupDest.Text = _MSConfig.PathBackupDestination;
|
||||||
|
UpRootRestoreSourceUI = _MSConfig.RootRestoreSource;
|
||||||
|
textRestoreSource.Text = _MSConfig.PathRestoreSource;
|
||||||
|
UpRootRestoreDestinationUI = _MSConfig.RootRestoreDestination;
|
||||||
|
textRestoreDest.Text = _MSConfig.PathRestoreDestination;
|
||||||
trackBar.Value = _MSConfig.CompressionLevel;
|
trackBar.Value = _MSConfig.CompressionLevel;
|
||||||
chkBackup.Checked = _MSConfig.EnableBackup;
|
chkBackup.Checked = _MSConfig.EnableBackup;
|
||||||
chkPurge.Checked = _MSConfig.EnablePurge;
|
chkPurge.Checked = _MSConfig.EnablePurge;
|
||||||
|
chkOverwriteBackup.Checked = _MSConfig.OverwriteBackup;
|
||||||
_MSConfig.userModifiedConfig = false;
|
UpTabSelection = _MSConfig.InBackupMode;
|
||||||
|
UpBackupSizeValue = "N/A";
|
||||||
|
UpSourceSizeValue = "N/A";
|
||||||
|
Width = _MSConfig.WindowWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -192,8 +254,11 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_SZNotInstalled, null);
|
DialogResult dr = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SZNotInstalled, null);
|
||||||
errors++;
|
errors++;
|
||||||
|
|
||||||
|
if (dr == DialogResult.Yes)
|
||||||
|
Process.Start("http://www.7-zip.org/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -211,8 +276,11 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_SZNotInstalled, null);
|
DialogResult dr = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SZNotInstalled, null);
|
||||||
errors++;
|
errors++;
|
||||||
|
|
||||||
|
if (dr == DialogResult.Yes)
|
||||||
|
Process.Start("http://www.7-zip.org/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,12 +299,12 @@ namespace MicronSync
|
|||||||
if (count == 2)
|
if (count == 2)
|
||||||
{
|
{
|
||||||
btnBackup.Enabled = true;
|
btnBackup.Enabled = true;
|
||||||
UpdateStatus = "Ready";
|
UpStatus = "Ready";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
btnBackup.Enabled = false;
|
btnBackup.Enabled = false;
|
||||||
UpdateStatus = "Please fill in the required fields";
|
UpStatus = "Please fill in the required fields";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,12 +320,12 @@ namespace MicronSync
|
|||||||
if (count == 2)
|
if (count == 2)
|
||||||
{
|
{
|
||||||
btnRestore.Enabled = true;
|
btnRestore.Enabled = true;
|
||||||
UpdateStatus = "Ready";
|
UpStatus = "Ready";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
btnRestore.Enabled = false;
|
btnRestore.Enabled = false;
|
||||||
UpdateStatus = "Please fill in the required fields";
|
UpStatus = "Please fill in the required fields";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +357,7 @@ namespace MicronSync
|
|||||||
case LMZAParser.endResult.Error:
|
case LMZAParser.endResult.Error:
|
||||||
break;
|
break;
|
||||||
case LMZAParser.endResult.Default:
|
case LMZAParser.endResult.Default:
|
||||||
statusLabel.Text = "Operation successful";
|
statusLabel.Text = $"Operation successful, completion time: {wui.compTime}";
|
||||||
break;
|
break;
|
||||||
case LMZAParser.endResult.TestArchive_Aborted:
|
case LMZAParser.endResult.TestArchive_Aborted:
|
||||||
statusLabel.Text = "Aborted test archive operation";
|
statusLabel.Text = "Aborted test archive operation";
|
||||||
@@ -314,11 +382,104 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show save changes dialog on exit.
|
||||||
|
/// </summary>
|
||||||
|
private void PromptSaveChanges()
|
||||||
|
{
|
||||||
|
// Reset value before proceeding.
|
||||||
|
hasCancelledExit = false;
|
||||||
|
|
||||||
|
// Only prompt if there are unsaved changes.
|
||||||
|
if (!_MSConfig.userModifiedConfig) return;
|
||||||
|
DialogResult result;
|
||||||
|
result = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SaveChanges, _MSConfig.openFile);
|
||||||
|
|
||||||
|
// Save to currently open file or to new one if there isn't one loaded.
|
||||||
|
if (result == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(_MSConfig.openFile))
|
||||||
|
{ _MSConfig.Save(); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_MSConfig.openFile =
|
||||||
|
_CommonIO.SaveFile(null, CommonIO.FileType.ini);
|
||||||
|
}
|
||||||
|
|
||||||
|
_MSConfig.Save();
|
||||||
|
}
|
||||||
|
else if (result == DialogResult.Cancel)
|
||||||
|
hasCancelledExit = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenWithExplorer(string path)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(path))
|
||||||
|
{
|
||||||
|
ProcessStartInfo psi = new ProcessStartInfo("explorer.exe", path);
|
||||||
|
Process.Start(psi);
|
||||||
|
}
|
||||||
|
else if (path == string.Empty || path == null)
|
||||||
|
{
|
||||||
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_EmptyExplorePath, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadExplorePath, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UseDarkTheme(bool darkTheme)
|
||||||
|
{
|
||||||
|
var darkColour = Color.FromArgb(64, 64, 64);
|
||||||
|
var lightColour = Color.White;
|
||||||
|
var darkText = Color.Black;
|
||||||
|
|
||||||
|
if (darkTheme)
|
||||||
|
{
|
||||||
|
enableDarkThemeToolStripMenuItem.CheckState = CheckState.Checked;
|
||||||
|
Settings.Default.UseDarkTheme = true;
|
||||||
|
|
||||||
|
// Backup Tab.
|
||||||
|
tabBackup.BackColor = darkColour;
|
||||||
|
labelBackupDest.ForeColor = lightColour;
|
||||||
|
groupBackupOptions.BackColor = darkColour;
|
||||||
|
groupBackupOptions.ForeColor = lightColour;
|
||||||
|
trackBar.BackColor = darkColour;
|
||||||
|
|
||||||
|
// Restore Tab.
|
||||||
|
tabRestore.BackColor = darkColour;
|
||||||
|
labelRestoreDest.ForeColor = lightColour;
|
||||||
|
groupRestoreOptions.BackColor = darkColour;
|
||||||
|
groupRestoreOptions.ForeColor = lightColour;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enableDarkThemeToolStripMenuItem.CheckState = CheckState.Unchecked;
|
||||||
|
Settings.Default.UseDarkTheme = false;
|
||||||
|
|
||||||
|
// Backup Tab.
|
||||||
|
tabBackup.BackColor = lightColour;
|
||||||
|
labelBackupDest.ForeColor = darkText;
|
||||||
|
groupBackupOptions.BackColor = lightColour;
|
||||||
|
groupBackupOptions.ForeColor = darkText;
|
||||||
|
trackBar.BackColor = lightColour;
|
||||||
|
|
||||||
|
// Restore Tab.
|
||||||
|
tabRestore.BackColor = lightColour;
|
||||||
|
labelRestoreDest.ForeColor = darkText;
|
||||||
|
groupRestoreOptions.BackColor = lightColour;
|
||||||
|
groupRestoreOptions.ForeColor = darkText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region UI Functionality
|
#region UI Functionality
|
||||||
|
|
||||||
private string UpdateStatus
|
#region UpdateUI
|
||||||
|
|
||||||
|
private string UpStatus
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -326,7 +487,7 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string UpdateTitlebar
|
private string UpTitlebar
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -337,41 +498,201 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private string UpSyncDate
|
||||||
/// Removes registration entry from menu if registered.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isLicenced"></param>
|
|
||||||
private void RemoveRegInfoMenubar(bool isLicenced)
|
|
||||||
{
|
{
|
||||||
if (isLicenced)
|
set
|
||||||
menuStrip1.Items.RemoveByKey("registerToolStripMenuItem");
|
{ labelSyncDate.Text = _CommonIO.CalculateDirectoryModifyDate(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private string UpBackupDate
|
||||||
/// Show save changes dialog on exit.
|
|
||||||
/// </summary>
|
|
||||||
private void PromptSaveChanges()
|
|
||||||
{
|
{
|
||||||
// Only prompt if there are unsaved changes.
|
set
|
||||||
if (!_MSConfig.userModifiedConfig) return;
|
{ labelBackupDate.Text = _CommonIO.CalculateFileModifyDate(value); }
|
||||||
DialogResult result;
|
}
|
||||||
result = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SaveChanges, _MSConfig.openFile);
|
|
||||||
|
|
||||||
// Save to currently open file or to new one if there isn't one loaded.
|
private string UpRootBackupSourceUI
|
||||||
if (result == DialogResult.Yes)
|
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty( _MSConfig.openFile))
|
set
|
||||||
{ _MSConfig.Save(); }
|
{
|
||||||
|
if (!string.IsNullOrEmpty(value))
|
||||||
|
if (!cmbRootBSrc.Items.Contains(value))
|
||||||
|
cmbRootBSrc.Items.Add(value);
|
||||||
|
cmbRootBSrc.SelectedItem = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string UpRootBackupDestinationUI
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(value))
|
||||||
|
if (!cmbRootBDst.Items.Contains(value))
|
||||||
|
cmbRootBDst.Items.Add(value);
|
||||||
|
cmbRootBDst.SelectedItem = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string UpRootRestoreSourceUI
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(value))
|
||||||
|
if (!cmbRootRSrc.Items.Contains(value))
|
||||||
|
cmbRootRSrc.Items.Add(value);
|
||||||
|
cmbRootRSrc.SelectedItem = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string UpRootRestoreDestinationUI
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(value))
|
||||||
|
if (!cmbRootRDst.Items.Contains(value))
|
||||||
|
cmbRootRDst.Items.Add(value);
|
||||||
|
cmbRootRDst.SelectedItem = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool UpTabSelection
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == true)
|
||||||
|
tabControl.SelectedTab = tabBackup;
|
||||||
else
|
else
|
||||||
{ _MSConfig.openFile =
|
tabControl.SelectedTab = tabRestore;
|
||||||
_CommonIO.SaveFile(null, CommonIO.FileType.ini); }
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_MSConfig.Save();
|
private int UpCompressionLevelText
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
textCompressionLevel.Text = Convert.ToString(value);
|
||||||
|
|
||||||
|
if (value == 0)
|
||||||
|
{
|
||||||
|
labelCompressionLevel.Text = "Compression Level: None";
|
||||||
|
cmbComPreset.SelectedItem = "Images/Video";
|
||||||
|
textCompressionLevel.BackColor = Color.RoyalBlue;
|
||||||
|
}
|
||||||
|
else if (value <= 3)
|
||||||
|
{
|
||||||
|
labelCompressionLevel.Text = "Compression Level: Low";
|
||||||
|
cmbComPreset.SelectedItem = "Software/Games";
|
||||||
|
textCompressionLevel.BackColor = Color.Turquoise;
|
||||||
|
}
|
||||||
|
else if (value <= 5)
|
||||||
|
{
|
||||||
|
labelCompressionLevel.Text = "Compression Level: Medium";
|
||||||
|
cmbComPreset.SelectedItem = "Mixed Content";
|
||||||
|
textCompressionLevel.BackColor = Color.Gold;
|
||||||
|
}
|
||||||
|
else if (value <= 7)
|
||||||
|
{
|
||||||
|
labelCompressionLevel.Text = "Compression Level: High";
|
||||||
|
textCompressionLevel.BackColor = Color.Orange;
|
||||||
|
}
|
||||||
|
else if (value == 9)
|
||||||
|
{
|
||||||
|
labelCompressionLevel.Text = "Compression Level: Maximum";
|
||||||
|
cmbComPreset.SelectedItem = "Databases/Text";
|
||||||
|
textCompressionLevel.BackColor = Color.Crimson;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string UpBackupSizeValue
|
||||||
|
{
|
||||||
|
set { labelBackupSizeValue.Text = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private string UpSourceSizeValue
|
||||||
|
{
|
||||||
|
set { labelSourceSizeValue.Text = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Update Paths
|
||||||
|
|
||||||
|
private void SetBackupSource(string fullPath)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(fullPath))
|
||||||
|
{
|
||||||
|
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||||
|
if (!string.IsNullOrEmpty(newRoot))
|
||||||
|
{
|
||||||
|
_MSConfig.RootBackupSource = newRoot;
|
||||||
|
_MSConfig.PathBackupSource = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||||
|
_MSConfig.RootBackupSource), String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWithConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetBackupDestination(string fullPath)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(fullPath))
|
||||||
|
{
|
||||||
|
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||||
|
if (!string.IsNullOrEmpty(newRoot))
|
||||||
|
{
|
||||||
|
_MSConfig.RootBackupDestination = newRoot;
|
||||||
|
_MSConfig.PathBackupDestination = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||||
|
_MSConfig.RootBackupDestination), String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWithConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRestoreSource(string fullPath)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(fullPath))
|
||||||
|
{
|
||||||
|
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||||
|
if (!string.IsNullOrEmpty(newRoot))
|
||||||
|
{
|
||||||
|
_MSConfig.RootRestoreSource = newRoot;
|
||||||
|
_MSConfig.PathRestoreSource = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||||
|
_MSConfig.RootRestoreSource), String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWithConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRestoreDestination(string fullPath)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(fullPath))
|
||||||
|
{
|
||||||
|
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||||
|
if (!string.IsNullOrEmpty(newRoot))
|
||||||
|
{
|
||||||
|
_MSConfig.RootRestoreDestination = newRoot;
|
||||||
|
_MSConfig.PathRestoreDestination = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||||
|
_MSConfig.RootRestoreDestination), String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWithConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Form
|
#region Form
|
||||||
|
|
||||||
|
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (tabControl.SelectedTab == tabBackup)
|
||||||
|
_MSConfig.InBackupMode = true;
|
||||||
|
else
|
||||||
|
_MSConfig.InBackupMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
private void textDescription_TextChanged(object sender, EventArgs e)
|
private void textDescription_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.Description = textDescription.Text;
|
_MSConfig.Description = textDescription.Text;
|
||||||
@@ -379,35 +700,43 @@ namespace MicronSync
|
|||||||
|
|
||||||
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
Settings.Default.Save();
|
||||||
PromptSaveChanges();
|
PromptSaveChanges();
|
||||||
|
|
||||||
|
if (!hasCancelledExit)
|
||||||
|
e.Cancel = false;
|
||||||
|
else
|
||||||
|
e.Cancel = true;
|
||||||
|
|
||||||
|
hasCancelledExit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBackupSource_TextChanged(object sender, EventArgs e)
|
private void textBackupSource_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.BackupSource = textBackupSource.Text;
|
_MSConfig.PathBackupSource = textBackupSource.Text;
|
||||||
labelSyncDate.Text = _CommonIO.CalculateDirectoryModifyDate(_MSConfig.BackupSource);
|
UpSyncDate = _MSConfig.BackupSource;
|
||||||
|
|
||||||
BackupButtonQualifier();
|
BackupButtonQualifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBackupDest_TextChanged(object sender, EventArgs e)
|
private void textBackupDest_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.BackupDestination = textBackupDest.Text;
|
_MSConfig.PathBackupDestination = textBackupDest.Text;
|
||||||
|
|
||||||
BackupButtonQualifier();
|
BackupButtonQualifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textRestoreSource_TextChanged(object sender, EventArgs e)
|
private void textRestoreSource_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.RestoreSource = textRestoreSource.Text;
|
_MSConfig.PathRestoreSource = textRestoreSource.Text;
|
||||||
labelBackupDate.Text = _CommonIO.CalculateFileModifyDate(_MSConfig.RestoreSource);
|
UpBackupDate = _MSConfig.RestoreSource;
|
||||||
|
|
||||||
RestoreButtonQualifier();
|
RestoreButtonQualifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textRestoreDest_TextChanged(object sender, EventArgs e)
|
private void textRestoreDest_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.RestoreDestination = textRestoreDest.Text;
|
_MSConfig.PathRestoreDestination = textRestoreDest.Text;
|
||||||
|
|
||||||
RestoreButtonQualifier();
|
RestoreButtonQualifier();
|
||||||
}
|
}
|
||||||
@@ -439,26 +768,34 @@ namespace MicronSync
|
|||||||
|
|
||||||
private void btnBackupBrowseSource_Click(object sender, EventArgs e)
|
private void btnBackupBrowseSource_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textBackupSource.Text = _CommonIO.BrowseFolder(
|
string fullPath = _CommonIO.BrowseFolder(
|
||||||
textBackupSource.Text);
|
textBackupSource.Text);
|
||||||
|
|
||||||
|
SetBackupSource(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnBackupBrowseDest_Click(object sender, EventArgs e)
|
private void btnBackupBrowseDest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textBackupDest.Text = _CommonIO.SaveFile(
|
string fullPath = _CommonIO.SaveFile(
|
||||||
textBackupDest.Text, CommonIO.FileType.sz);
|
textBackupDest.Text, CommonIO.FileType.sz);
|
||||||
|
|
||||||
|
SetBackupDestination(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRestoreSource_Click(object sender, EventArgs e)
|
private void btnRestoreSource_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textRestoreSource.Text = _CommonIO.OpenFile(
|
string fullPath = _CommonIO.OpenFile(
|
||||||
textRestoreSource.Text, CommonIO.FileType.sz);
|
textRestoreSource.Text, CommonIO.FileType.sz);
|
||||||
|
|
||||||
|
SetRestoreSource(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRestoreDest_Click(object sender, EventArgs e)
|
private void btnRestoreDest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textRestoreDest.Text = _CommonIO.BrowseFolder(
|
string fullPath = _CommonIO.BrowseFolder(
|
||||||
textRestoreDest.Text);
|
textRestoreDest.Text);
|
||||||
|
|
||||||
|
SetRestoreDestination(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkMirrorSrcToDst_CheckedChanged(object sender, EventArgs e)
|
private void checkMirrorSrcToDst_CheckedChanged(object sender, EventArgs e)
|
||||||
@@ -487,11 +824,17 @@ namespace MicronSync
|
|||||||
private void checkBackup_CheckedChanged(object sender, EventArgs e)
|
private void checkBackup_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.EnableBackup = chkBackup.Checked;
|
_MSConfig.EnableBackup = chkBackup.Checked;
|
||||||
|
|
||||||
|
if (chkBackup.CheckState == CheckState.Checked)
|
||||||
|
chkOverwriteBackup.Enabled = true;
|
||||||
|
else
|
||||||
|
chkOverwriteBackup.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackBar_ValueChanged(object sender, EventArgs e)
|
private void trackBar_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_MSConfig.CompressionLevel = trackBar.Value;
|
_MSConfig.CompressionLevel = trackBar.Value;
|
||||||
|
UpCompressionLevelText = trackBar.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRestore_Click(object sender, EventArgs e)
|
private void btnRestore_Click(object sender, EventArgs e)
|
||||||
@@ -530,6 +873,93 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cmbRootBSrc_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_MSConfig.RootBackupSource = cmbRootBSrc.SelectedItem.ToString();
|
||||||
|
|
||||||
|
UpSyncDate = _MSConfig.BackupSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbRootBDst_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_MSConfig.RootBackupDestination = cmbRootBDst.SelectedItem.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbRootRSrc_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_MSConfig.RootRestoreSource = cmbRootRSrc.SelectedItem.ToString();
|
||||||
|
|
||||||
|
UpBackupDate = _MSConfig.RestoreSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbRootRDst_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_MSConfig.RootRestoreDestination = cmbRootRDst.SelectedItem.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbComPreset_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (cmbComPreset.SelectedItem.ToString() == "Software/Games")
|
||||||
|
trackBar.Value = 2;
|
||||||
|
else if (cmbComPreset.SelectedItem.ToString() == "Images/Video")
|
||||||
|
trackBar.Value = 0;
|
||||||
|
else if (cmbComPreset.SelectedItem.ToString() == "Databases/Text")
|
||||||
|
trackBar.Value = 9;
|
||||||
|
else if (cmbComPreset.SelectedItem.ToString() == "Mixed Content")
|
||||||
|
trackBar.Value = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCalcBackupSize_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (File.Exists(_MSConfig.RestoreSource))
|
||||||
|
UpBackupSizeValue = $"{_CommonIO.CalculateFileSizeMB(_MSConfig.RestoreSource)}MB";
|
||||||
|
else
|
||||||
|
UpBackupSizeValue = "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSourceSize_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(_MSConfig.BackupSource))
|
||||||
|
{
|
||||||
|
DirSizeCalculatorPrompt dirCalc = new DirSizeCalculatorPrompt();
|
||||||
|
dirCalc.TargetDirectory = _MSConfig.BackupSource;
|
||||||
|
dirCalc.ShowDialog();
|
||||||
|
|
||||||
|
UpSourceSizeValue = $"{dirCalc.Result}MB";
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
UpSourceSizeValue = "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnExploreBSource_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenWithExplorer(_MSConfig.BackupSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnExploreRDestination_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenWithExplorer(_MSConfig.RestoreDestination);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void chkOverwriteBackup_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_MSConfig.OverwriteBackup = chkOverwriteBackup.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainWindow_SizeChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_MSConfig.WindowWidth = Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enableDarkThemeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (enableDarkThemeToolStripMenuItem.CheckState == CheckState.Checked)
|
||||||
|
UseDarkTheme(true);
|
||||||
|
else
|
||||||
|
UseDarkTheme(false);
|
||||||
|
}
|
||||||
|
|
||||||
#region Drag and drop
|
#region Drag and drop
|
||||||
|
|
||||||
private void MainWindow_DragEnter(object sender, DragEventArgs e)
|
private void MainWindow_DragEnter(object sender, DragEventArgs e)
|
||||||
@@ -550,19 +980,19 @@ namespace MicronSync
|
|||||||
switch (dropUi.DropResult)
|
switch (dropUi.DropResult)
|
||||||
{
|
{
|
||||||
case DropUI.DropAction.SzUseRestore:
|
case DropUI.DropAction.SzUseRestore:
|
||||||
textRestoreSource.Text = DropUI.dropData;
|
SetRestoreSource(DropUI.dropData);
|
||||||
tabControl.SelectedTab = tabRestore;
|
tabControl.SelectedTab = tabRestore;
|
||||||
break;
|
break;
|
||||||
case DropUI.DropAction.SzUseBackup:
|
case DropUI.DropAction.SzUseBackup:
|
||||||
textBackupDest.Text = DropUI.dropData;
|
SetBackupDestination(DropUI.dropData);
|
||||||
tabControl.SelectedTab = tabBackup;
|
tabControl.SelectedTab = tabBackup;
|
||||||
break;
|
break;
|
||||||
case DropUI.DropAction.DirUseBackup:
|
case DropUI.DropAction.DirUseBackup:
|
||||||
textBackupSource.Text = DropUI.dropData;
|
SetBackupSource(DropUI.dropData);
|
||||||
tabControl.SelectedTab = tabBackup;
|
tabControl.SelectedTab = tabBackup;
|
||||||
break;
|
break;
|
||||||
case DropUI.DropAction.DirUseRestore:
|
case DropUI.DropAction.DirUseRestore:
|
||||||
textRestoreDest.Text = DropUI.dropData;
|
SetRestoreDestination(DropUI.dropData);
|
||||||
tabControl.SelectedTab = tabRestore;
|
tabControl.SelectedTab = tabRestore;
|
||||||
break;
|
break;
|
||||||
case DropUI.DropAction.LoadConfig:
|
case DropUI.DropAction.LoadConfig:
|
||||||
@@ -581,25 +1011,25 @@ namespace MicronSync
|
|||||||
|
|
||||||
private void btnRepBackupSource_Click(object sender, EventArgs e)
|
private void btnRepBackupSource_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textRestoreDest.Text = textBackupSource.Text;
|
SetRestoreDestination(_MSConfig.BackupSource);
|
||||||
tabControl.SelectedTab = tabRestore;
|
tabControl.SelectedTab = tabRestore;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRepBackupDest_Click(object sender, EventArgs e)
|
private void btnRepBackupDest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textRestoreSource.Text = textBackupDest.Text;
|
SetRestoreSource(_MSConfig.BackupDestination);
|
||||||
tabControl.SelectedTab = tabRestore;
|
tabControl.SelectedTab = tabRestore;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRepRestoreSource_Click(object sender, EventArgs e)
|
private void btnRepRestoreSource_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textBackupDest.Text = textRestoreSource.Text;
|
SetBackupDestination(_MSConfig.RestoreSource);
|
||||||
tabControl.SelectedTab = tabBackup;
|
tabControl.SelectedTab = tabBackup;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRepRestoreDest_Click(object sender, EventArgs e)
|
private void btnRepRestoreDest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
textBackupSource.Text = textRestoreDest.Text;
|
SetBackupSource(_MSConfig.RestoreDestination);
|
||||||
tabControl.SelectedTab = tabBackup;
|
tabControl.SelectedTab = tabBackup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,16 +1041,25 @@ namespace MicronSync
|
|||||||
|
|
||||||
private void newToolStripMenuItem_Click(object sender, EventArgs e)
|
private void newToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
saveToolStripMenuItem.Enabled = false;
|
if (_MSConfig.userModifiedConfig)
|
||||||
|
PromptSaveChanges();
|
||||||
|
if (!hasCancelledExit)
|
||||||
|
{
|
||||||
|
|
||||||
_MSConfig = new MSConfig();
|
_MSConfig = new MSConfig();
|
||||||
UpdateWithConfig();
|
UpdateWithConfig();
|
||||||
|
|
||||||
UpdateStatus = "New job";
|
UpStatus = "New job";
|
||||||
|
saveToolStripMenuItem.Enabled = false;
|
||||||
|
_MSConfig.userModifiedConfig = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (_MSConfig.userModifiedConfig)
|
||||||
|
PromptSaveChanges();
|
||||||
|
if (!hasCancelledExit)
|
||||||
OpenConfig(true, null, false);
|
OpenConfig(true, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -629,7 +1068,7 @@ namespace MicronSync
|
|||||||
if (!string.IsNullOrEmpty(_MSConfig.openFile))
|
if (!string.IsNullOrEmpty(_MSConfig.openFile))
|
||||||
_MSConfig.Save();
|
_MSConfig.Save();
|
||||||
|
|
||||||
UpdateStatus = "Save successful";
|
UpStatus = "Save successful";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
@@ -640,19 +1079,13 @@ namespace MicronSync
|
|||||||
{
|
{
|
||||||
_MSConfig.openFile = saveFile;
|
_MSConfig.openFile = saveFile;
|
||||||
_MSConfig.Save();
|
_MSConfig.Save();
|
||||||
UpdateStatus = "Save successful";
|
UpStatus = "Save successful";
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateTitlebar = saveFile;
|
UpTitlebar = saveFile;
|
||||||
saveToolStripMenuItem.Enabled = true;
|
saveToolStripMenuItem.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
PromptSaveChanges();
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
|
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AboutBox about = new AboutBox();
|
AboutBox about = new AboutBox();
|
||||||
@@ -683,6 +1116,29 @@ namespace MicronSync
|
|||||||
cl.ShowDialog();
|
cl.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void refreshDrivesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Retrieve user modified config status before altering values.
|
||||||
|
bool _userModifiedConfig = _MSConfig.userModifiedConfig;
|
||||||
|
|
||||||
|
string RootBSource = (cmbRootBSrc.SelectedItem != null) ? cmbRootBSrc.SelectedItem.ToString() : null;
|
||||||
|
string RootBDestination = (cmbRootBDst.SelectedItem != null) ? cmbRootBDst.SelectedItem.ToString() : null;
|
||||||
|
string RootRSource = (cmbRootRSrc.SelectedItem != null) ? cmbRootRSrc.SelectedItem.ToString() : null;
|
||||||
|
string RootRDestination = (cmbRootRDst.SelectedItem != null) ? cmbRootRDst.SelectedItem.ToString() : null;
|
||||||
|
|
||||||
|
PopulateRootLists();
|
||||||
|
|
||||||
|
// Match selected items with loaded values.
|
||||||
|
UpRootBackupSourceUI = RootBSource;
|
||||||
|
UpRootBackupDestinationUI = RootBDestination;
|
||||||
|
UpRootRestoreSourceUI = RootRSource;
|
||||||
|
UpRootRestoreDestinationUI = RootRDestination;
|
||||||
|
|
||||||
|
// Unflag save prompt if no changes have been made to config.
|
||||||
|
if (!_userModifiedConfig)
|
||||||
|
_MSConfig.userModifiedConfig = false;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -699,7 +1155,7 @@ namespace MicronSync
|
|||||||
@"C:\System Volume Information"
|
@"C:\System Volume Information"
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly int minPathLength = 4;
|
//private readonly int minPathLength = 4;
|
||||||
|
|
||||||
private bool IsDirectoryAllowed(string input)
|
private bool IsDirectoryAllowed(string input)
|
||||||
{
|
{
|
||||||
@@ -761,11 +1217,14 @@ namespace MicronSync
|
|||||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_RestrictedPath, dst);
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_RestrictedPath, dst);
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* No longer checking for length/
|
||||||
else if (src.Length < minPathLength || dst.Length < minPathLength)
|
else if (src.Length < minPathLength || dst.Length < minPathLength)
|
||||||
{
|
{
|
||||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_PathRootInvalid, null);
|
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_PathRootInvalid, null);
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|||||||
+228
-52
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -15,6 +16,7 @@ namespace MicronSync
|
|||||||
/// Flags value to be included in configuration.
|
/// Flags value to be included in configuration.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class SaveToConfigAttribute : Attribute { }
|
internal class SaveToConfigAttribute : Attribute { }
|
||||||
|
CommonIO _CIO = new CommonIO();
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
protected void OnPropertyChanged()
|
protected void OnPropertyChanged()
|
||||||
@@ -23,6 +25,13 @@ namespace MicronSync
|
|||||||
userModifiedConfig = true;
|
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
|
||||||
{
|
{
|
||||||
@@ -42,55 +51,7 @@ namespace MicronSync
|
|||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _Description;
|
private string _Description = "";
|
||||||
|
|
||||||
[SaveToConfig]
|
|
||||||
public string BackupSource
|
|
||||||
{
|
|
||||||
get { return _BackupSource; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_BackupSource = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private string _BackupSource;
|
|
||||||
|
|
||||||
[SaveToConfig]
|
|
||||||
public string BackupDestination
|
|
||||||
{
|
|
||||||
get { return _BackupDestination; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_BackupDestination = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private string _BackupDestination;
|
|
||||||
|
|
||||||
[SaveToConfig]
|
|
||||||
public string RestoreSource
|
|
||||||
{
|
|
||||||
get { return _RestoreSource; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_RestoreSource = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private string _RestoreSource;
|
|
||||||
|
|
||||||
[SaveToConfig]
|
|
||||||
public string RestoreDestination
|
|
||||||
{
|
|
||||||
get { return _RestoreDestintation; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_RestoreDestintation = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private string _RestoreDestintation;
|
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public bool EnablePurge
|
public bool EnablePurge
|
||||||
@@ -116,6 +77,18 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
private bool _EnableBackup;
|
private bool _EnableBackup;
|
||||||
|
|
||||||
|
[SaveToConfig]
|
||||||
|
public bool OverwriteBackup
|
||||||
|
{
|
||||||
|
get { return _OverwriteBackup; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_OverwriteBackup = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private bool _OverwriteBackup;
|
||||||
|
|
||||||
[SaveToConfig]
|
[SaveToConfig]
|
||||||
public int CompressionLevel
|
public int CompressionLevel
|
||||||
{
|
{
|
||||||
@@ -128,9 +101,185 @@ namespace MicronSync
|
|||||||
}
|
}
|
||||||
private int _CompressionLevel = 4;
|
private int _CompressionLevel = 4;
|
||||||
|
|
||||||
|
[SaveToConfig]
|
||||||
|
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 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 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; }
|
||||||
|
|
||||||
public bool userModifiedConfig { get; set; } = false;
|
public bool userModifiedConfig { get; set; } = false;
|
||||||
|
|
||||||
|
public Version loadedVersion { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MSConfig : Values
|
public class MSConfig : Values
|
||||||
@@ -165,24 +314,31 @@ namespace MicronSync
|
|||||||
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)
|
||||||
@@ -191,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,12 @@
|
|||||||
<DependentUpon>ChangeLog.cs</DependentUpon>
|
<DependentUpon>ChangeLog.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Components\CommonIO.cs" />
|
<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">
|
<Compile Include="Components\Forms\DonationUI.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -132,6 +138,7 @@
|
|||||||
<Compile Include="Components\Forms\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>
|
||||||
@@ -139,6 +146,11 @@
|
|||||||
<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\Forms\AboutBox.resx">
|
<EmbeddedResource Include="Components\Forms\AboutBox.resx">
|
||||||
@@ -147,6 +159,9 @@
|
|||||||
<EmbeddedResource Include="Components\Forms\ChangeLog.resx">
|
<EmbeddedResource Include="Components\Forms\ChangeLog.resx">
|
||||||
<DependentUpon>ChangeLog.cs</DependentUpon>
|
<DependentUpon>ChangeLog.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Components\Forms\DirSizeCalculatorPrompt.resx">
|
||||||
|
<DependentUpon>DirSizeCalculatorPrompt.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Components\Forms\DonationUI.resx">
|
<EmbeddedResource Include="Components\Forms\DonationUI.resx">
|
||||||
<DependentUpon>DonationUI.cs</DependentUpon>
|
<DependentUpon>DonationUI.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
@@ -172,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>
|
||||||
@@ -189,6 +205,10 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Components\Forms\ChangeLog.txt" />
|
<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.1.0.1")]
|
[assembly: AssemblyVersion("1.3.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.1.0.1")]
|
[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