Imported MicronSync v1.0.0.0

This commit is contained in:
2019-03-05 21:27:05 +00:00
parent 5c734d6832
commit b3fa1bb74c
42 changed files with 17329 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicronSync", "MicronSync\MicronSync.csproj", "{85713D72-FF1F-47BC-B034-FB20ADF4A84A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+202
View File
@@ -0,0 +1,202 @@
namespace MicronSync.Components
{
partial class AboutBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox));
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.labelRegistered = new System.Windows.Forms.Label();
this.logoPictureBox = new System.Windows.Forms.PictureBox();
this.labelProductName = new System.Windows.Forms.Label();
this.labelVersion = new System.Windows.Forms.Label();
this.labelCopyright = new System.Windows.Forms.Label();
this.labelCompanyName = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.textBoxDescription = new System.Windows.Forms.TextBox();
this.tableLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel
//
this.tableLayoutPanel.ColumnCount = 2;
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.48387F));
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 64.51613F));
this.tableLayoutPanel.Controls.Add(this.labelRegistered, 1, 4);
this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0);
this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2);
this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 6);
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 7;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265);
this.tableLayoutPanel.TabIndex = 0;
//
// labelRegistered
//
this.labelRegistered.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelRegistered.Location = new System.Drawing.Point(153, 104);
this.labelRegistered.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelRegistered.MaximumSize = new System.Drawing.Size(0, 17);
this.labelRegistered.Name = "labelRegistered";
this.labelRegistered.Size = new System.Drawing.Size(261, 17);
this.labelRegistered.TabIndex = 25;
this.labelRegistered.Text = "Registered:";
this.labelRegistered.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// logoPictureBox
//
this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
this.logoPictureBox.Name = "logoPictureBox";
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
this.logoPictureBox.Size = new System.Drawing.Size(141, 230);
this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.logoPictureBox.TabIndex = 12;
this.logoPictureBox.TabStop = false;
//
// labelProductName
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(153, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(261, 17);
this.labelProductName.TabIndex = 19;
this.labelProductName.Text = "Product Name";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelVersion
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(153, 26);
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(261, 17);
this.labelVersion.TabIndex = 0;
this.labelVersion.Text = "Version";
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelCopyright
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(153, 52);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(261, 17);
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Text = "Copyright";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelCompanyName
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(153, 78);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(261, 17);
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "Company Name";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(339, 239);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 24;
this.okButton.Text = "&OK";
//
// textBoxDescription
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(153, 133);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(261, 100);
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Text = "Description";
//
// AboutBox
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(435, 283);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox";
this.Padding = new System.Windows.Forms.Padding(9);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "AboutBox";
this.tableLayoutPanel.ResumeLayout(false);
this.tableLayoutPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
private System.Windows.Forms.PictureBox logoPictureBox;
private System.Windows.Forms.Label labelProductName;
private System.Windows.Forms.Label labelVersion;
private System.Windows.Forms.Label labelCopyright;
private System.Windows.Forms.Label labelCompanyName;
private System.Windows.Forms.TextBox textBoxDescription;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Label labelRegistered;
}
}
+124
View File
@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MicronSync.Components
{
partial class AboutBox : Form
{
public AboutBox()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
this.labelRegistered.Text += " " + RegisteredStatus;
}
#region Assembly Attribute Accessors
public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
public string RegisteredStatus
{
get
{
string status = null;
if (Licencer.isRegistered)
{
status = "Yes";
}
else
{
status = "No";
}
return status;
}
}
#endregion
}
}
+201
View File
@@ -0,0 +1,201 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="logoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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
</value>
</data>
</root>
+218
View File
@@ -0,0 +1,218 @@
using System;
using System.IO;
namespace MicronSync
{
/// <summary>
/// Provides common IO functionality via Windows Forms.
/// </summary>
public class CommonIO : IDisposable
{
/// <summary>
/// Browse to existing folder on the system.
/// </summary>
/// <param name="originalPath"></param>
/// <returns></returns>
public string BrowseFolder(string originalPath)
{
// The result of the Windows Forms dialog is passed as a
// string to the method caller.
var folder = new System.Windows.Forms.FolderBrowserDialog();
System.Windows.Forms.DialogResult result = folder.ShowDialog();
// Only change the value if a valid path is entered.
string newPath;
if (folder.SelectedPath != "") { newPath = folder.SelectedPath.ToString(); }
else { newPath = originalPath; }
return newPath;
}
public enum FileType { sz, ini }
public string SaveFile(string originalPath, FileType f)
{
var file = new System.Windows.Forms.SaveFileDialog();
switch (f)
{
case FileType.sz:
file.Filter = "7-Zip File|*.7z";
file.DefaultExt = ".7z";
break;
case FileType.ini:
file.Filter = "Config File|*.ini";
file.DefaultExt = ".ini";
break;
default:
break;
}
file.AddExtension = true;
System.Windows.Forms.DialogResult result = file.ShowDialog();
// Only change the value if a valid path is entered.
string newPath;
if (file.FileName != "") { newPath = file.FileName.ToString(); }
else { newPath = originalPath; }
return newPath;
}
public string OpenFile(string originalPath, FileType f)
{
var file = new System.Windows.Forms.OpenFileDialog();
switch (f)
{
case FileType.sz:
file.Filter = "7-Zip File|*.7z";
file.DefaultExt = ".7z";
break;
case FileType.ini:
file.Filter = "Config File|*.ini";
file.DefaultExt = ".ini";
break;
default:
break;
}
file.AddExtension = true;
System.Windows.Forms.DialogResult result = file.ShowDialog();
// Only change the value if a valid path is entered.
string newPath;
if (file.FileName != "") { newPath = file.FileName.ToString(); }
else { newPath = originalPath; }
return newPath;
}
public string CalculateDirectoryModifyDate (string dir)
{
string result = null;
try
{
if (Directory.Exists(dir))
result = string.Format("{0} - {1}",
Directory.GetLastWriteTime(dir).ToShortDateString(),
Directory.GetLastWriteTime(dir).ToLongTimeString());
else
result = "N/A";
}
catch (System.Exception)
{
throw;
}
return result;
}
public string CalculateFileModifyDate(string file)
{
string result = null;
try
{
if (File.Exists(file))
result = string.Format("{0} - {1}",
File.GetLastWriteTime(file).ToShortDateString(),
File.GetLastWriteTime(file).ToLongTimeString());
else
result = "N/A";
}
catch (System.Exception)
{
throw;
}
return result;
}
#region Filesystem Modification
public enum endResult
{
ClearEntireDirectory_Error,
CopyEntireDirectory_Error,
Default,
FileNotExist,
}
public endResult ClearEntireDirectory(string dir)
{
endResult _endResult = endResult.Default;
try
{
string[] files = Directory.GetFiles(dir, "*.*", SearchOption.AllDirectories);
string[] dirs = Directory.GetDirectories(dir, "*", SearchOption.AllDirectories);
foreach (var file in files)
{
File.SetAttributes(file, FileAttributes.Normal);
File.Delete(file);
}
foreach (var directory in dirs)
{
if (Directory.Exists(directory))
Directory.Delete(directory, true);
}
}
catch (Exception)
{
_endResult = endResult.ClearEntireDirectory_Error;
}
return _endResult;
}
public endResult CopyEntireDirectory(string src, string dst)
{
endResult _endResult = endResult.Default;
try
{
// Generate list of all directories in source and create backup directory.
DirectoryInfo dir = new DirectoryInfo(src);
DirectoryInfo[] dirs = dir.GetDirectories();
if (!Directory.Exists(dst))
Directory.CreateDirectory(dst);
else
{
Directory.Delete(dst, true);
Directory.CreateDirectory(dst);
}
// Copy all files to destination.
FileInfo[] files = dir.GetFiles();
foreach (FileInfo file in files)
{
File.Copy(Path.Combine(src, file.Name),
Path.Combine(dst, file.Name));
}
// Repeat for subdirectories.
foreach (DirectoryInfo subDir in dirs)
{
CopyEntireDirectory(subDir.FullName,
Path.Combine(dst, subDir.Name));
}
}
catch (Exception)
{
_endResult = endResult.CopyEntireDirectory_Error;
}
return _endResult;
}
#endregion
public void Dispose()
{
GC.Collect();
}
}
}
+172
View File
@@ -0,0 +1,172 @@
namespace MicronSync.Components
{
partial class DonationUI
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DonationUI));
this.textInfo = new System.Windows.Forms.RichTextBox();
this.progWait = new System.Windows.Forms.ProgressBar();
this.btnContinue = new System.Windows.Forms.Button();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.registerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.enterRegistrationKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buyKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.websiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// textInfo
//
this.textInfo.BackColor = System.Drawing.SystemColors.Window;
this.textInfo.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textInfo.Location = new System.Drawing.Point(112, 36);
this.textInfo.Name = "textInfo";
this.textInfo.ReadOnly = true;
this.textInfo.Size = new System.Drawing.Size(460, 96);
this.textInfo.TabIndex = 2;
this.textInfo.Text = resources.GetString("textInfo.Text");
//
// progWait
//
this.progWait.Location = new System.Drawing.Point(12, 138);
this.progWait.Name = "progWait";
this.progWait.Size = new System.Drawing.Size(479, 23);
this.progWait.Step = 20;
this.progWait.TabIndex = 1;
//
// btnContinue
//
this.btnContinue.Enabled = false;
this.btnContinue.Location = new System.Drawing.Point(497, 138);
this.btnContinue.Name = "btnContinue";
this.btnContinue.Size = new System.Drawing.Size(75, 23);
this.btnContinue.TabIndex = 0;
this.btnContinue.Text = "Continue";
this.btnContinue.UseVisualStyleBackColor = true;
this.btnContinue.Click += new System.EventHandler(this.btnContinue_Click);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.registerToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(584, 24);
this.menuStrip1.TabIndex = 3;
this.menuStrip1.Text = "menuStrip1";
//
// registerToolStripMenuItem
//
this.registerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.enterRegistrationKeyToolStripMenuItem,
this.buyKeyToolStripMenuItem,
this.toolStripSeparator1,
this.websiteToolStripMenuItem});
this.registerToolStripMenuItem.Name = "registerToolStripMenuItem";
this.registerToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.registerToolStripMenuItem.Text = "Register";
//
// enterRegistrationKeyToolStripMenuItem
//
this.enterRegistrationKeyToolStripMenuItem.Name = "enterRegistrationKeyToolStripMenuItem";
this.enterRegistrationKeyToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
this.enterRegistrationKeyToolStripMenuItem.Text = "Enter donation key...";
this.enterRegistrationKeyToolStripMenuItem.Click += new System.EventHandler(this.enterRegistrationKeyToolStripMenuItem_Click);
//
// buyKeyToolStripMenuItem
//
this.buyKeyToolStripMenuItem.Name = "buyKeyToolStripMenuItem";
this.buyKeyToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
this.buyKeyToolStripMenuItem.Text = "Donate...";
this.buyKeyToolStripMenuItem.Click += new System.EventHandler(this.donateToolStripMenuItem_Click);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(12, 36);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(94, 96);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 4;
this.pictureBox1.TabStop = false;
//
// websiteToolStripMenuItem
//
this.websiteToolStripMenuItem.Name = "websiteToolStripMenuItem";
this.websiteToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
this.websiteToolStripMenuItem.Text = "Website...";
this.websiteToolStripMenuItem.Click += new System.EventHandler(this.websiteToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(179, 6);
//
// DonationUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(584, 171);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btnContinue);
this.Controls.Add(this.progWait);
this.Controls.Add(this.textInfo);
this.Controls.Add(this.menuStrip1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Name = "DonationUI";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MicronSync - Donation";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DonationUI_FormClosing);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox textInfo;
private System.Windows.Forms.ProgressBar progWait;
private System.Windows.Forms.Button btnContinue;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem registerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enterRegistrationKeyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem buyKeyToolStripMenuItem;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.ToolStripMenuItem websiteToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
}
}
+116
View File
@@ -0,0 +1,116 @@
using System;
using System.ComponentModel;
using System.Threading;
using System.Windows.Forms;
namespace MicronSync.Components
{
public partial class DonationUI : Form
{
public static readonly string donateUrl = "http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K5TKEUREWNCA8";
public static readonly string websiteUrl = "http://reboundsoftware.weebly.com";
private bool userCloseForm = false;
private bool timerStopped = false;
public DonationUI()
{
InitializeComponent();
StartTimer();
}
private void StartTimer()
{
timerStopped = false;
bwTimer.DoWork += BwTimer_DoWork;
bwTimer.RunWorkerCompleted += BwTimer_RunWorkerCompleted;
bwTimer.ProgressChanged += BwTimer_ProgressChanged;
bwTimer.WorkerReportsProgress = true;
bwTimer.RunWorkerAsync();
}
#region Timer
BackgroundWorker bwTimer = new BackgroundWorker();
private void BwTimer_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progWait.PerformStep();
}
private void BwTimer_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (progWait.Value == 100)
{
userCloseForm = true;
btnContinue.Enabled = true;
}
}
private void BwTimer_DoWork(object sender, DoWorkEventArgs e)
{
int position = progWait.Value;
int stepAmount = progWait.Step;
while (progWait.Value < 100 &&
!timerStopped)
{
Thread.Sleep(1000);
position += stepAmount;
bwTimer.ReportProgress(position);
}
}
#endregion
#region Form
private void DonationUI_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
if (userCloseForm)
e.Cancel = false;
}
private void btnContinue_Click(object sender, EventArgs e)
{
Close();
}
private void enterRegistrationKeyToolStripMenuItem_Click(object sender, EventArgs e)
{
timerStopped = true;
NewRegKeyUI newKey = new NewRegKeyUI();
newKey.ShowDialog();
if (!newKey.userKeyValid)
{
StartTimer();
}
else
{
bwTimer.Dispose();
userCloseForm = true;
Close();
}
}
private void donateToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(
donateUrl);
}
private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(
websiteUrl);
}
#endregion
}
}
File diff suppressed because it is too large Load Diff
+233
View File
@@ -0,0 +1,233 @@
using System;
using System.Diagnostics;
using System.Threading;
namespace MicronSync
{
public class LMZAParser : IDisposable
{
public Process proc = new Process();
bool abortProcess = false;
public enum endResult
{
MakePackage_Aborted,
ExtractPackage_Aborted,
ExtractPackage_Error,
MakePackage_Error,
Aborted,
Error,
Default,
TestArchive_Aborted,
TestArchive_Error
}
public static string szExePath { get; set; }
public static string szWorkDir { get; set; }
public endResult MakePackage(string fileName, string sourceDir, string destDir, int compressLvl, string password, bool sfx)
{
endResult _endResult = endResult.Default;
string argMethod = " a ";
Func<string, string> argSourceDir = SourceDir;
Func<string, string, string> argDestDir = DestDir;
Func<int, string> argCompressLvl = CompressLvl;
Func<string, string> argPassword = Password;
Func<bool, string> argSfx = Sfx;
_endResult = RunProcess(argMethod +
argSfx(sfx) +
argDestDir(destDir, fileName) +
argPassword(password) +
argSourceDir(sourceDir) +
argCompressLvl(compressLvl));
// Convert generic error to MakePackage error.
switch (_endResult)
{
case endResult.Aborted:
_endResult = endResult.MakePackage_Aborted;
break;
case endResult.Error:
_endResult = endResult.MakePackage_Error;
break;
default:
break;
}
return _endResult;
}
#region MakePackage
private string Sfx(bool arg)
{
// Appends SFX parameter to archive.
string result = null;
if (arg)
{
result = "-sfx";
}
return result;
}
private string CompressLvl(int arg)
{
return String.Format("-mx={0}", arg.ToString());
}
private string DestDir(string path, string file)
{
// Combines the path and filename into one.
return String.Format("\"{0}\\{1}\" ", path, file);
}
private string SourceDir(string arg)
{
return String.Format("\"{0}\\*\" ", arg);
}
private string Password(string pass)
{
string result = null;
if (pass != "") { result += String.Format("-p{0} -mhe ", pass); }
return result;
}
#endregion
public endResult ExtractPackage(string fileName, string inDir, string outDir, string password)
{
endResult _endResult = endResult.Default;
// Test archive before attempting to extract it
// DO NOT DO THIS WITH HUGE PACKAGES!
//exitCode += TestArchive(fileName, inDir, password);
string argMethod = " x ";
//Func<string, string> argSourceDir = SourceDir;
//Func<string, string, string> argDestDir = DestDir;
Func<string, string, string> argInDir = InDir;
Func<string, string> argOutDir = OutDir;
Func<string, string> argOutPassword = OutPassword;
_endResult = RunProcess(argMethod +
argInDir(inDir, fileName) +
argOutPassword(password) +
argOutDir(outDir));
// Convert generic error to ExtractPackage error.
switch (_endResult)
{
case endResult.Aborted:
_endResult = endResult.ExtractPackage_Aborted;
break;
case endResult.Error:
_endResult = endResult.ExtractPackage_Error;
break;
default:
break;
}
return _endResult;
}
#region ExtractPackage
private string OutDir(string path)
{
return String.Format("-o\"{0}\" ", path);
}
private string InDir(string path, string file)
{
return String.Format("\"{0}\\{1}\" -aoa ", path, file);
}
private string OutPassword(string pass)
{
return String.Format("-p{0} ", pass);
}
#endregion
public endResult TestArchive(string fileName, string inDir, string password)
{
endResult _endResult = endResult.Default;
string argMethod = " t ";
Func<string, string, string> argInDir = InDir;
Func<string, string> argOutPassword = OutPassword;
_endResult = RunProcess(argMethod +
argInDir(inDir, fileName) +
argOutPassword(password));
// Convert generic error to TestArchive error.
switch (_endResult)
{
case endResult.Aborted:
_endResult = endResult.TestArchive_Aborted;
break;
case endResult.Error:
_endResult = endResult.TestArchive_Error;
break;
default:
break;
}
return _endResult;
}
/// <summary>
/// Run 7-zip with command line arguments.
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private endResult RunProcess(string args)
{
endResult _endResult = endResult.Default;
try
{
proc.StartInfo.FileName = szExePath;
proc.StartInfo.WorkingDirectory = szWorkDir;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
///
proc.StartInfo.Arguments = args;
proc.Start();
while (!proc.HasExited)
{
Thread.Sleep(1000);
Console.WriteLine("DEBUG: LMZA process is alive...");
if (abortProcess)
{
_endResult = endResult.Aborted;
proc.Kill();
Console.WriteLine("DEBUG: LMZA process aborted");
}
}
if (proc.ExitCode > 0)
_endResult = endResult.Error;
}
catch (Exception)
{
_endResult = endResult.Error;
proc.Dispose();
}
return _endResult;
}
public void Abort() { abortProcess = true; }
public void Dispose()
{
if (!proc.HasExited)
proc.Kill();
proc.Dispose();
}
}
}
+94
View File
@@ -0,0 +1,94 @@
using Microsoft.Win32;
using System;
namespace MicronSync.Components
{
public class Licencer
{
private readonly string privateKey = "TRZzjAutdtA542aeQj";
private readonly string msRegPath = @"SOFTWARE\MicronSync\";
private readonly string msRegKey = "Key";
public static bool isRegistered { get; set; } = false;
public bool CheckForExistingLicence()
{
bool licenceExists = false;
try
{
var regPath = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
var regKey = regPath?.OpenSubKey(msRegPath);
var value = regKey?.GetValue(msRegKey);
bool isValidKey = ValidateKey((string)value);
if (isValidKey)
{
licenceExists = true;
}
else if (regKey != null && !isValidKey)
{
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
Environment.Exit(2);
}
}
catch (Exception)
{
licenceExists = false;
}
return licenceExists;
}
public void ShowDonationPrompt()
{
DonationUI dui = new DonationUI();
dui.ShowDialog();
}
/// <summary>
/// Returns legitimacy of key.
/// </summary>
/// <param name="input">Key to check.</param>
/// <returns>Key is genuine.</returns>
public bool ValidateKey(string input)
{
SKGL.Validate skgl = new SKGL.Validate();
skgl.secretPhase = privateKey;
skgl.Key = input.ToUpper();
return skgl.IsValid;
}
/// <summary>
/// Stores key into user level registry.
/// </summary>
/// <param name="key"></param>
public void SetKey(string key)
{
try
{
var regPath = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
var regKey = regPath.CreateSubKey(msRegPath);
regKey.SetValue(msRegKey, key.ToUpper(), RegistryValueKind.String);
}
catch (Exception)
{
throw;
}
}
/// <summary>
/// Generate new key based on internal private key.
/// </summary>
/// <returns></returns>
public string CreateNewKey()
{
SKGL.Generate skgl = new SKGL.Generate();
skgl.secretPhase = privateKey;
return skgl.doKey(0, DateTime.Now);
}
}
}
+146
View File
@@ -0,0 +1,146 @@
using System.Windows.Forms;
namespace MicronSync
{
public class MessageHandler
{
// Call error messages by specifying an enum code
public enum msgCodes
{
_TestSample,
MainWindow_Warn_Purge,
MainWindow_Warn_Purge_Null,
MainWindow_Warn_OverwriteFile,
NewRegKeyUI_CorrectKey,
MainWindow_SaveChanges,
}
public enum errCodes
{
_TestSample,
MainWindow_SZNotInstalled,
WorkerUI_BadBackupPath,
WorkerUI_BadRestorePath,
MainWindow_RestrictedPath,
MainWindow_PathRootInvalid,
MainWindow_DstWithinSrc,
MainWindow_RestoreError,
MainWindow_BackupError,
Config_WriteError,
Config_ReadError,
MainWindow_ArchiveNotFound,
NewRegKeyUI_InvalidKey,
NewRegKeyUI_PirateKey,
MainWindow_BadConfigFile,
}
/// <summary>
/// Create an error message dialogue box.
/// </summary>
/// <param name="mc"></param>
/// <param name="info"></param>
internal static void errorMessage(errCodes mc, string info)
{
switch (mc)
{
case errCodes._TestSample:
MessageBox.Show("This is a sample error message", "Sample Error Message",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.MainWindow_SZNotInstalled:
MessageBox.Show("7-Zip is not currently installed but is required for MicronSync to run.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.WorkerUI_BadBackupPath:
MessageBox.Show("The specified source path is inaccessible. Please ensure the path exists and you have read/write permission, then try again.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.WorkerUI_BadRestorePath:
MessageBox.Show("The specified restore path is inaccessible. Please ensure the file exists and try again.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.MainWindow_RestrictedPath:
MessageBox.Show($"The following path cannot be used:\n{info}", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.MainWindow_PathRootInvalid:
MessageBox.Show($"Drive roots cannot be used. Please select a valid sub-directory.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.MainWindow_DstWithinSrc:
MessageBox.Show($"Your destination and source paths cannot be within one-another. Please enter valid paths and try again.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.MainWindow_RestoreError:
MessageBox.Show($"There was a problem restoring from the selected backup. Please ensure you have sufficient read/write access.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.MainWindow_BackupError:
MessageBox.Show($"There was a problem backing up the selected directory, check you have entered the correct path. Additionally, ensure you have sufficient read/write access.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.Config_WriteError:
MessageBox.Show($"Failed to write configuration file.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.Config_ReadError:
MessageBox.Show($"The current directory is either write-protected or the configuration file is corrupt.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.MainWindow_ArchiveNotFound:
MessageBox.Show($"The backup file specified does not exist.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
case errCodes.NewRegKeyUI_InvalidKey:
MessageBox.Show($"The key you have entered is invalid. Please ensure you have typed it in the correct format.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.NewRegKeyUI_PirateKey:
MessageBox.Show($"You have imported a bad key onto your system. Please delete it to continue using this software.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case errCodes.MainWindow_BadConfigFile:
MessageBox.Show($"Unable to load configuration, unsupported file.", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
}
}
/// <summary>
/// Create an informational message dialogue box.
/// </summary>
/// <param name="mc"></param>
/// <param name="info"></param>
/// <returns></returns>
internal static DialogResult stdMessage(msgCodes mc, string info)
{
DialogResult _dialogResult = DialogResult.None;
switch (mc)
{
case msgCodes.MainWindow_Warn_Purge:
_dialogResult = MessageBox.Show($"Purging will permanently delete ALL data within the following directory prior to attempting to restore:\n\"{info}\"\n\nBacking up is strongly recommended, continue enabling option?", "MicronSync - Dangerous operation",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
break;
case msgCodes.MainWindow_Warn_Purge_Null:
_dialogResult = MessageBox.Show($"Purging will permanently delete ALL data within the restore destintation directory prior to attempting to restore.\n\nBacking up is strongly recommended, continue enabling option?", "MicronSync - Dangerous operation",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
break;
case msgCodes.MainWindow_Warn_OverwriteFile:
_dialogResult = MessageBox.Show($"There is already a file with the same name in the specified directory:\n{info}\n\nWould you like to overwrite it?", "MicronSync - Confirm overwrite",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
break;
case msgCodes.NewRegKeyUI_CorrectKey:
_dialogResult = MessageBox.Show($"Thank you for registering MicronSync :-)", "MicronSync",
MessageBoxButtons.OK, MessageBoxIcon.Information);
break;
case msgCodes.MainWindow_SaveChanges:
_dialogResult = MessageBox.Show($"Save changes to file before exiting?\n{info}", "MicronSync",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
break;
}
return _dialogResult;
}
}
}
+196
View File
@@ -0,0 +1,196 @@
namespace MicronSync.Components
{
partial class NewRegKeyUI
{
/// <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.textKey1 = new System.Windows.Forms.TextBox();
this.btnAccept = new System.Windows.Forms.Button();
this.textKey2 = new System.Windows.Forms.TextBox();
this.textKey3 = new System.Windows.Forms.TextBox();
this.textKey4 = new System.Windows.Forms.TextBox();
this.labelDash1 = new System.Windows.Forms.Label();
this.labelDash2 = new System.Windows.Forms.Label();
this.labelDash3 = new System.Windows.Forms.Label();
this.btnClipboard = new System.Windows.Forms.Button();
this.btnClear = new System.Windows.Forms.Button();
this.labelEnterKey = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// textKey1
//
this.textKey1.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textKey1.Location = new System.Drawing.Point(16, 51);
this.textKey1.MaxLength = 5;
this.textKey1.Name = "textKey1";
this.textKey1.Size = new System.Drawing.Size(48, 20);
this.textKey1.TabIndex = 0;
this.textKey1.TextChanged += new System.EventHandler(this.textKey1_TextChanged);
this.textKey1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey1_KeyPress);
//
// btnAccept
//
this.btnAccept.Location = new System.Drawing.Point(297, 50);
this.btnAccept.Name = "btnAccept";
this.btnAccept.Size = new System.Drawing.Size(75, 23);
this.btnAccept.TabIndex = 4;
this.btnAccept.Text = "Accept";
this.btnAccept.UseVisualStyleBackColor = true;
this.btnAccept.Click += new System.EventHandler(this.btnAccept_Click);
//
// textKey2
//
this.textKey2.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textKey2.Location = new System.Drawing.Point(87, 51);
this.textKey2.MaxLength = 5;
this.textKey2.Name = "textKey2";
this.textKey2.Size = new System.Drawing.Size(48, 20);
this.textKey2.TabIndex = 1;
this.textKey2.TextChanged += new System.EventHandler(this.textKey2_TextChanged);
this.textKey2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey2_KeyPress);
//
// textKey3
//
this.textKey3.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textKey3.Location = new System.Drawing.Point(158, 51);
this.textKey3.MaxLength = 5;
this.textKey3.Name = "textKey3";
this.textKey3.Size = new System.Drawing.Size(48, 20);
this.textKey3.TabIndex = 2;
this.textKey3.TextChanged += new System.EventHandler(this.textKey3_TextChanged);
this.textKey3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey3_KeyPress);
//
// textKey4
//
this.textKey4.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textKey4.Location = new System.Drawing.Point(230, 51);
this.textKey4.MaxLength = 5;
this.textKey4.Name = "textKey4";
this.textKey4.Size = new System.Drawing.Size(48, 20);
this.textKey4.TabIndex = 3;
this.textKey4.TextChanged += new System.EventHandler(this.textKey4_TextChanged);
this.textKey4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey4_KeyPress);
//
// labelDash1
//
this.labelDash1.AutoSize = true;
this.labelDash1.Location = new System.Drawing.Point(71, 54);
this.labelDash1.Name = "labelDash1";
this.labelDash1.Size = new System.Drawing.Size(10, 13);
this.labelDash1.TabIndex = 6;
this.labelDash1.Text = "-";
//
// labelDash2
//
this.labelDash2.AutoSize = true;
this.labelDash2.Location = new System.Drawing.Point(142, 55);
this.labelDash2.Name = "labelDash2";
this.labelDash2.Size = new System.Drawing.Size(10, 13);
this.labelDash2.TabIndex = 7;
this.labelDash2.Text = "-";
//
// labelDash3
//
this.labelDash3.AutoSize = true;
this.labelDash3.Location = new System.Drawing.Point(214, 55);
this.labelDash3.Name = "labelDash3";
this.labelDash3.Size = new System.Drawing.Size(10, 13);
this.labelDash3.TabIndex = 8;
this.labelDash3.Text = "-";
//
// btnClipboard
//
this.btnClipboard.Location = new System.Drawing.Point(16, 86);
this.btnClipboard.Name = "btnClipboard";
this.btnClipboard.Size = new System.Drawing.Size(119, 23);
this.btnClipboard.TabIndex = 5;
this.btnClipboard.Text = "Paste from clipboard";
this.btnClipboard.UseVisualStyleBackColor = true;
this.btnClipboard.Click += new System.EventHandler(this.btnClipboard_Click);
//
// btnClear
//
this.btnClear.Location = new System.Drawing.Point(297, 86);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(75, 23);
this.btnClear.TabIndex = 6;
this.btnClear.Text = "Clear";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// labelEnterKey
//
this.labelEnterKey.AutoSize = true;
this.labelEnterKey.Location = new System.Drawing.Point(13, 13);
this.labelEnterKey.Name = "labelEnterKey";
this.labelEnterKey.Size = new System.Drawing.Size(143, 13);
this.labelEnterKey.TabIndex = 9;
this.labelEnterKey.Text = "Please enter your key below:";
//
// NewRegKeyUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 121);
this.Controls.Add(this.labelEnterKey);
this.Controls.Add(this.btnClear);
this.Controls.Add(this.btnClipboard);
this.Controls.Add(this.labelDash3);
this.Controls.Add(this.labelDash2);
this.Controls.Add(this.labelDash1);
this.Controls.Add(this.textKey4);
this.Controls.Add(this.textKey3);
this.Controls.Add(this.textKey2);
this.Controls.Add(this.btnAccept);
this.Controls.Add(this.textKey1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "NewRegKeyUI";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MicronSync - Enter key";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NewRegKeyUI_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textKey1;
private System.Windows.Forms.Button btnAccept;
private System.Windows.Forms.TextBox textKey2;
private System.Windows.Forms.TextBox textKey3;
private System.Windows.Forms.TextBox textKey4;
private System.Windows.Forms.Label labelDash1;
private System.Windows.Forms.Label labelDash2;
private System.Windows.Forms.Label labelDash3;
private System.Windows.Forms.Button btnClipboard;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Label labelEnterKey;
}
}
+146
View File
@@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace MicronSync.Components
{
public partial class NewRegKeyUI : Form
{
public bool userKeyValid = false;
private readonly Licencer _licencer = new Licencer();
public NewRegKeyUI()
{
InitializeComponent();
}
#region Transform text to uppercase.
private void textKey1_KeyPress(object sender, KeyPressEventArgs e)
{
e.KeyChar = Char.ToUpper(e.KeyChar);
}
private void textKey2_KeyPress(object sender, KeyPressEventArgs e)
{
e.KeyChar = Char.ToUpper(e.KeyChar);
}
private void textKey3_KeyPress(object sender, KeyPressEventArgs e)
{
e.KeyChar = Char.ToUpper(e.KeyChar);
}
private void textKey4_KeyPress(object sender, KeyPressEventArgs e)
{
e.KeyChar = Char.ToUpper(e.KeyChar);
}
#endregion
#region Automatically move cursor to next element.
private void textKey1_TextChanged(object sender, EventArgs e)
{
if (textKey1.TextLength == 5)
textKey2.Focus();
}
private void textKey2_TextChanged(object sender, EventArgs e)
{
if (textKey2.TextLength == 5)
textKey3.Focus();
}
private void textKey3_TextChanged(object sender, EventArgs e)
{
if (textKey3.TextLength == 5)
textKey4.Focus();
}
private void textKey4_TextChanged(object sender, EventArgs e)
{
if (textKey4.TextLength == 5)
btnAccept.Focus();
}
#endregion
private void ClearAllText()
{
textKey1.Clear();
textKey2.Clear();
textKey3.Clear();
textKey4.Clear();
}
private void btnAccept_Click(object sender, EventArgs e)
{
List<string> keyParts = new List<string>();
keyParts.Add(textKey1.Text + "-");
keyParts.Add(textKey2.Text + "-");
keyParts.Add(textKey3.Text + "-");
keyParts.Add(textKey4.Text);
string fullKey = null;
foreach (var part in keyParts)
{
fullKey += part;
}
userKeyValid = _licencer.ValidateKey(fullKey);
if (userKeyValid)
{
MessageHandler.stdMessage(MessageHandler.msgCodes.NewRegKeyUI_CorrectKey, null);
_licencer.SetKey(fullKey);
Close();
}
else
{
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_InvalidKey, null);
}
}
private void btnClipboard_Click(object sender, EventArgs e)
{
ClearAllText();
string clipboard = Clipboard.GetText(TextDataFormat.Text)
.Replace("-", "").ToUpper();
for (int i = 0; i < clipboard.Length; i++)
{
if (i < 5)
{
textKey1.Text += clipboard[i].ToString();
}
else if (i < 10)
{
textKey2.Text += clipboard[i].ToString();
}
else if (i < 15)
{
textKey3.Text += clipboard[i].ToString();
}
else if (i < 20)
{
textKey4.Text += clipboard[i].ToString();
}
}
}
private void btnClear_Click(object sender, EventArgs e)
{
ClearAllText();
}
/// Update is user registered status.
private void NewRegKeyUI_FormClosing(object sender, FormClosingEventArgs e)
{
Licencer.isRegistered = userKeyValid;
}
}
}
+120
View File
@@ -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>
+75
View File
@@ -0,0 +1,75 @@
namespace MicronSync.Components
{
partial class Worker
{
/// <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.label1 = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(261, 25);
this.label1.TabIndex = 0;
this.label1.Text = "Operation in progress...";
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(97, 76);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// Worker
//
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.btnCancel);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "Worker";
this.Text = "Worker";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnCancel;
}
}
+52
View File
@@ -0,0 +1,52 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
namespace MicronSync.Components
{
public partial class Worker : Form
{
public int exitCode = 0;
public int customInt
{
get; set;
}
public Worker()
{
InitializeComponent();
BackgroundWorker lmzaPackage = new BackgroundWorker();
lmzaPackage.DoWork += LmzaPackage_DoWork;
//lmzaPackage.RunWorkerAsync();
}
private void LmzaPackage_DoWork(object sender, DoWorkEventArgs e)
{
using (LMZAParser parser = new LMZAParser())
{
try
{
exitCode = parser.MakePackage(
Path.GetFileName(StoreCfg.backupDst),
Path.GetDirectoryName(StoreCfg.backupSrc),
Path.GetDirectoryName(StoreCfg.backupDst),
StoreCfg.compressionLvl,
"",
false);
}
catch (Exception)
{
throw;
}
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
}
}
}
+120
View File
@@ -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>
+77
View File
@@ -0,0 +1,77 @@
namespace MicronSync.Components
{
partial class WorkerUI
{
/// <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.labelProcessing = new System.Windows.Forms.Label();
this.buttonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// labelProcessing
//
this.labelProcessing.AutoSize = true;
this.labelProcessing.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelProcessing.Location = new System.Drawing.Point(13, 13);
this.labelProcessing.Name = "labelProcessing";
this.labelProcessing.Size = new System.Drawing.Size(257, 25);
this.labelProcessing.TabIndex = 0;
this.labelProcessing.Text = "Processing, please wait...";
//
// 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 = 1;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// WorkerUI
//
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.labelProcessing);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "WorkerUI";
this.Text = "MicronSync";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WorkerUI_FormClosing);
this.Load += new System.EventHandler(this.WorkerUI_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelProcessing;
private System.Windows.Forms.Button buttonCancel;
}
}
+132
View File
@@ -0,0 +1,132 @@
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
{
public partial class WorkerUI : Form
{
public WorkerMode SetWorkerMode { get; internal set; }
public enum WorkerMode
{
Backup,
Restore
}
public LMZAParser.endResult _endResultLMZA = LMZAParser.endResult.Default;
public CommonIO.endResult _endResultCIO = CommonIO.endResult.Default;
private readonly MSConfig _ManageConfig_RO = MainWindow._MSConfig;
public WorkerUI()
{
InitializeComponent();
}
#region Workers
BackgroundWorker lmzaBackup = new BackgroundWorker();
BackgroundWorker lmzaRestore = new BackgroundWorker();
LMZAParser lmzaParser = new LMZAParser();
private void LmzaBackup_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
canClose = true;
Close();
}
private void LmzaBackup_DoWork(object sender, DoWorkEventArgs e)
{
_endResultLMZA = lmzaParser.MakePackage(
Path.GetFileName(_ManageConfig_RO.BackupDestination),
_ManageConfig_RO.BackupSource,
Path.GetDirectoryName(_ManageConfig_RO.BackupDestination),
_ManageConfig_RO.CompressionLevel,
"",
false);
}
private void LmzaRestore_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
canClose = true;
Close();
}
private void LmzaRestore_DoWork(object sender, DoWorkEventArgs e)
{
// Only continue if file exists!
bool fileExists = false;
if (File.Exists(_ManageConfig_RO.RestoreSource))
fileExists = true;
else
_endResultCIO = CommonIO.endResult.FileNotExist;
// Only continue if above is true.
if (fileExists)
{
// Process params.
using (CommonIO cio = new CommonIO())
{
if (_ManageConfig_RO.EnableBackup)
{
_endResultCIO = cio.CopyEntireDirectory(_ManageConfig_RO.RestoreDestination,
_ManageConfig_RO.RestoreDestination + ".Backup");
}
if (_ManageConfig_RO.EnablePurge)
_endResultCIO = cio.ClearEntireDirectory(_ManageConfig_RO.RestoreDestination);
}
if (_endResultCIO == CommonIO.endResult.Default)
_endResultLMZA = lmzaParser.ExtractPackage(
Path.GetFileName(_ManageConfig_RO.RestoreSource),
Path.GetDirectoryName(_ManageConfig_RO.RestoreSource),
_ManageConfig_RO.RestoreDestination,
"");
}
}
#endregion
#region Form Functionality
private bool canClose = false;
private void WorkerUI_Load(object sender, EventArgs e)
{
switch (SetWorkerMode)
{
case WorkerMode.Backup:
lmzaBackup.DoWork += LmzaBackup_DoWork;
lmzaBackup.RunWorkerCompleted += LmzaBackup_RunWorkerCompleted;
lmzaBackup.RunWorkerAsync();
break;
case WorkerMode.Restore:
lmzaRestore.DoWork += LmzaRestore_DoWork;
lmzaRestore.RunWorkerCompleted += LmzaRestore_RunWorkerCompleted;
lmzaRestore.RunWorkerAsync();
break;
}
}
private void buttonCancel_Click(object sender, EventArgs e)
{
lmzaParser.Abort();
}
private void WorkerUI_FormClosing(object sender, FormClosingEventArgs e)
{
if (!canClose)
e.Cancel = true;
else
e.Cancel = false;
}
#endregion
}
}
+120
View File
@@ -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>
Binary file not shown.
+638
View File
@@ -0,0 +1,638 @@
namespace MicronSync
{
partial class MainWindow
{
/// <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.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
this.groupRestoreOptions = new System.Windows.Forms.GroupBox();
this.chkBackup = new System.Windows.Forms.CheckBox();
this.chkPurge = new System.Windows.Forms.CheckBox();
this.trackBar = new System.Windows.Forms.TrackBar();
this.labelCompressionLevel = new System.Windows.Forms.Label();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.toolStripStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.btnRestore = new System.Windows.Forms.Button();
this.btnBackup = new System.Windows.Forms.Button();
this.labelSyncDate = new System.Windows.Forms.Label();
this.labelBackupDate = new System.Windows.Forms.Label();
this.tabControl = new System.Windows.Forms.TabControl();
this.tabBackup = new System.Windows.Forms.TabPage();
this.labelLastChange = new System.Windows.Forms.Label();
this.groupBackupOptions = new System.Windows.Forms.GroupBox();
this.labelMaxCompression = new System.Windows.Forms.Label();
this.labelNoCompression = new System.Windows.Forms.Label();
this.labelBackupSource = new System.Windows.Forms.Label();
this.btnBackupBrowseDest = new System.Windows.Forms.Button();
this.textBackupSource = new System.Windows.Forms.TextBox();
this.btnBackupBrowseSource = new System.Windows.Forms.Button();
this.labelBackupDest = new System.Windows.Forms.Label();
this.textBackupDest = new System.Windows.Forms.TextBox();
this.tabRestore = new System.Windows.Forms.TabPage();
this.labelLastBackup = new System.Windows.Forms.Label();
this.labelRestoreSource = new System.Windows.Forms.Label();
this.btnRestoreBrowseDest = new System.Windows.Forms.Button();
this.textRestoreSource = new System.Windows.Forms.TextBox();
this.btnRestoreBrowseSource = new System.Windows.Forms.Button();
this.labelRestoreDest = new System.Windows.Forms.Label();
this.textRestoreDest = new System.Windows.Forms.TextBox();
this.labelDescription = new System.Windows.Forms.Label();
this.textDescription = new System.Windows.Forms.TextBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.websiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.registerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.enterDonationKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.donateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupRestoreOptions.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
this.statusStrip.SuspendLayout();
this.tabControl.SuspendLayout();
this.tabBackup.SuspendLayout();
this.groupBackupOptions.SuspendLayout();
this.tabRestore.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupRestoreOptions
//
this.groupRestoreOptions.Controls.Add(this.chkBackup);
this.groupRestoreOptions.Controls.Add(this.chkPurge);
this.groupRestoreOptions.Location = new System.Drawing.Point(161, 85);
this.groupRestoreOptions.Name = "groupRestoreOptions";
this.groupRestoreOptions.Size = new System.Drawing.Size(229, 96);
this.groupRestoreOptions.TabIndex = 4;
this.groupRestoreOptions.TabStop = false;
this.groupRestoreOptions.Text = "Restore Options";
//
// chkBackup
//
this.chkBackup.AutoSize = true;
this.chkBackup.Location = new System.Drawing.Point(9, 42);
this.chkBackup.Name = "chkBackup";
this.chkBackup.Size = new System.Drawing.Size(174, 17);
this.chkBackup.TabIndex = 8;
this.chkBackup.Text = "Backup source before restoring";
this.chkBackup.UseVisualStyleBackColor = true;
this.chkBackup.CheckedChanged += new System.EventHandler(this.checkBackup_CheckedChanged);
//
// chkPurge
//
this.chkPurge.AutoSize = true;
this.chkPurge.Location = new System.Drawing.Point(9, 19);
this.chkPurge.Name = "chkPurge";
this.chkPurge.Size = new System.Drawing.Size(132, 17);
this.chkPurge.TabIndex = 7;
this.chkPurge.Text = "Purge source directory";
this.chkPurge.UseVisualStyleBackColor = true;
this.chkPurge.CheckedChanged += new System.EventHandler(this.checkMirrorSrcToDst_CheckedChanged);
//
// trackBar
//
this.trackBar.BackColor = System.Drawing.Color.White;
this.trackBar.Location = new System.Drawing.Point(9, 34);
this.trackBar.Maximum = 9;
this.trackBar.Name = "trackBar";
this.trackBar.Size = new System.Drawing.Size(213, 45);
this.trackBar.TabIndex = 6;
this.trackBar.Value = 4;
this.trackBar.ValueChanged += new System.EventHandler(this.trackBar_ValueChanged);
//
// labelCompressionLevel
//
this.labelCompressionLevel.AutoSize = true;
this.labelCompressionLevel.Location = new System.Drawing.Point(123, 16);
this.labelCompressionLevel.Name = "labelCompressionLevel";
this.labelCompressionLevel.Size = new System.Drawing.Size(99, 13);
this.labelCompressionLevel.TabIndex = 2;
this.labelCompressionLevel.Text = "Compression Level:";
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatus,
this.statusLabel});
this.statusStrip.Location = new System.Drawing.Point(0, 294);
this.statusStrip.Name = "statusStrip";
this.statusStrip.Size = new System.Drawing.Size(434, 22);
this.statusStrip.SizingGrip = false;
this.statusStrip.TabIndex = 5;
this.statusStrip.Text = "statusStrip1";
//
// toolStripStatus
//
this.toolStripStatus.Name = "toolStripStatus";
this.toolStripStatus.Size = new System.Drawing.Size(0, 17);
//
// statusLabel
//
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(0, 17);
//
// btnRestore
//
this.btnRestore.Enabled = false;
this.btnRestore.Location = new System.Drawing.Point(10, 145);
this.btnRestore.Name = "btnRestore";
this.btnRestore.Size = new System.Drawing.Size(141, 36);
this.btnRestore.TabIndex = 10;
this.btnRestore.Text = "Restore";
this.btnRestore.UseVisualStyleBackColor = true;
this.btnRestore.Click += new System.EventHandler(this.btnRestore_Click);
//
// btnBackup
//
this.btnBackup.Enabled = false;
this.btnBackup.Location = new System.Drawing.Point(10, 145);
this.btnBackup.Name = "btnBackup";
this.btnBackup.Size = new System.Drawing.Size(141, 36);
this.btnBackup.TabIndex = 9;
this.btnBackup.Text = "Backup";
this.btnBackup.UseVisualStyleBackColor = true;
this.btnBackup.Click += new System.EventHandler(this.btnBackup_Click);
//
// labelSyncDate
//
this.labelSyncDate.AutoSize = true;
this.labelSyncDate.Location = new System.Drawing.Point(8, 129);
this.labelSyncDate.Name = "labelSyncDate";
this.labelSyncDate.Size = new System.Drawing.Size(27, 13);
this.labelSyncDate.TabIndex = 11;
this.labelSyncDate.Text = "N/A";
this.labelSyncDate.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// labelBackupDate
//
this.labelBackupDate.AutoSize = true;
this.labelBackupDate.Location = new System.Drawing.Point(8, 129);
this.labelBackupDate.Name = "labelBackupDate";
this.labelBackupDate.Size = new System.Drawing.Size(27, 13);
this.labelBackupDate.TabIndex = 12;
this.labelBackupDate.Text = "N/A";
this.labelBackupDate.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// tabControl
//
this.tabControl.Controls.Add(this.tabBackup);
this.tabControl.Controls.Add(this.tabRestore);
this.tabControl.Location = new System.Drawing.Point(13, 64);
this.tabControl.Multiline = true;
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(407, 214);
this.tabControl.TabIndex = 1;
//
// tabBackup
//
this.tabBackup.Controls.Add(this.labelLastChange);
this.tabBackup.Controls.Add(this.groupBackupOptions);
this.tabBackup.Controls.Add(this.labelBackupSource);
this.tabBackup.Controls.Add(this.btnBackupBrowseDest);
this.tabBackup.Controls.Add(this.textBackupSource);
this.tabBackup.Controls.Add(this.btnBackupBrowseSource);
this.tabBackup.Controls.Add(this.labelBackupDest);
this.tabBackup.Controls.Add(this.labelSyncDate);
this.tabBackup.Controls.Add(this.textBackupDest);
this.tabBackup.Controls.Add(this.btnBackup);
this.tabBackup.Location = new System.Drawing.Point(4, 22);
this.tabBackup.Name = "tabBackup";
this.tabBackup.Padding = new System.Windows.Forms.Padding(3);
this.tabBackup.Size = new System.Drawing.Size(399, 188);
this.tabBackup.TabIndex = 0;
this.tabBackup.Text = "Backup";
this.tabBackup.UseVisualStyleBackColor = true;
//
// labelLastChange
//
this.labelLastChange.AutoSize = true;
this.labelLastChange.Location = new System.Drawing.Point(8, 110);
this.labelLastChange.Name = "labelLastChange";
this.labelLastChange.Size = new System.Drawing.Size(117, 13);
this.labelLastChange.TabIndex = 29;
this.labelLastChange.Text = "Last change commited:";
//
// groupBackupOptions
//
this.groupBackupOptions.Controls.Add(this.labelMaxCompression);
this.groupBackupOptions.Controls.Add(this.labelNoCompression);
this.groupBackupOptions.Controls.Add(this.trackBar);
this.groupBackupOptions.Controls.Add(this.labelCompressionLevel);
this.groupBackupOptions.Location = new System.Drawing.Point(161, 85);
this.groupBackupOptions.Name = "groupBackupOptions";
this.groupBackupOptions.Size = new System.Drawing.Size(229, 96);
this.groupBackupOptions.TabIndex = 21;
this.groupBackupOptions.TabStop = false;
this.groupBackupOptions.Text = "Backup Options";
//
// labelMaxCompression
//
this.labelMaxCompression.AutoSize = true;
this.labelMaxCompression.Location = new System.Drawing.Point(195, 65);
this.labelMaxCompression.Name = "labelMaxCompression";
this.labelMaxCompression.Size = new System.Drawing.Size(27, 13);
this.labelMaxCompression.TabIndex = 8;
this.labelMaxCompression.Text = "Max";
this.labelMaxCompression.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelNoCompression
//
this.labelNoCompression.AutoSize = true;
this.labelNoCompression.Location = new System.Drawing.Point(15, 65);
this.labelNoCompression.Name = "labelNoCompression";
this.labelNoCompression.Size = new System.Drawing.Size(33, 13);
this.labelNoCompression.TabIndex = 7;
this.labelNoCompression.Text = "None";
//
// labelBackupSource
//
this.labelBackupSource.AutoSize = true;
this.labelBackupSource.Location = new System.Drawing.Point(7, 16);
this.labelBackupSource.Name = "labelBackupSource";
this.labelBackupSource.Size = new System.Drawing.Size(48, 13);
this.labelBackupSource.TabIndex = 14;
this.labelBackupSource.Text = "*Source:";
//
// btnBackupBrowseDest
//
this.btnBackupBrowseDest.Location = new System.Drawing.Point(360, 51);
this.btnBackupBrowseDest.Name = "btnBackupBrowseDest";
this.btnBackupBrowseDest.Size = new System.Drawing.Size(30, 20);
this.btnBackupBrowseDest.TabIndex = 5;
this.btnBackupBrowseDest.Text = "...";
this.btnBackupBrowseDest.UseVisualStyleBackColor = true;
this.btnBackupBrowseDest.Click += new System.EventHandler(this.btnBackupBrowseDest_Click);
//
// textBackupSource
//
this.textBackupSource.Location = new System.Drawing.Point(84, 13);
this.textBackupSource.Name = "textBackupSource";
this.textBackupSource.Size = new System.Drawing.Size(271, 20);
this.textBackupSource.TabIndex = 2;
this.textBackupSource.TextChanged += new System.EventHandler(this.textBackupSource_TextChanged);
//
// btnBackupBrowseSource
//
this.btnBackupBrowseSource.Location = new System.Drawing.Point(360, 13);
this.btnBackupBrowseSource.Name = "btnBackupBrowseSource";
this.btnBackupBrowseSource.Size = new System.Drawing.Size(30, 20);
this.btnBackupBrowseSource.TabIndex = 3;
this.btnBackupBrowseSource.Text = "...";
this.btnBackupBrowseSource.UseVisualStyleBackColor = true;
this.btnBackupBrowseSource.Click += new System.EventHandler(this.btnBackupBrowseSource_Click);
//
// labelBackupDest
//
this.labelBackupDest.AutoSize = true;
this.labelBackupDest.Location = new System.Drawing.Point(7, 54);
this.labelBackupDest.Name = "labelBackupDest";
this.labelBackupDest.Size = new System.Drawing.Size(67, 13);
this.labelBackupDest.TabIndex = 16;
this.labelBackupDest.Text = "*Destination:";
//
// textBackupDest
//
this.textBackupDest.Location = new System.Drawing.Point(84, 51);
this.textBackupDest.Name = "textBackupDest";
this.textBackupDest.Size = new System.Drawing.Size(270, 20);
this.textBackupDest.TabIndex = 4;
this.textBackupDest.TextChanged += new System.EventHandler(this.textBackupDest_TextChanged);
//
// tabRestore
//
this.tabRestore.Controls.Add(this.labelLastBackup);
this.tabRestore.Controls.Add(this.labelRestoreSource);
this.tabRestore.Controls.Add(this.btnRestoreBrowseDest);
this.tabRestore.Controls.Add(this.groupRestoreOptions);
this.tabRestore.Controls.Add(this.textRestoreSource);
this.tabRestore.Controls.Add(this.labelBackupDate);
this.tabRestore.Controls.Add(this.btnRestoreBrowseSource);
this.tabRestore.Controls.Add(this.btnRestore);
this.tabRestore.Controls.Add(this.labelRestoreDest);
this.tabRestore.Controls.Add(this.textRestoreDest);
this.tabRestore.Location = new System.Drawing.Point(4, 22);
this.tabRestore.Name = "tabRestore";
this.tabRestore.Padding = new System.Windows.Forms.Padding(3);
this.tabRestore.Size = new System.Drawing.Size(399, 188);
this.tabRestore.TabIndex = 1;
this.tabRestore.Text = "Restore";
this.tabRestore.UseVisualStyleBackColor = true;
//
// labelLastBackup
//
this.labelLastBackup.AutoSize = true;
this.labelLastBackup.Location = new System.Drawing.Point(8, 110);
this.labelLastBackup.Name = "labelLastBackup";
this.labelLastBackup.Size = new System.Drawing.Size(69, 13);
this.labelLastBackup.TabIndex = 28;
this.labelLastBackup.Text = "Last backup:";
//
// labelRestoreSource
//
this.labelRestoreSource.AutoSize = true;
this.labelRestoreSource.Location = new System.Drawing.Point(7, 16);
this.labelRestoreSource.Name = "labelRestoreSource";
this.labelRestoreSource.Size = new System.Drawing.Size(48, 13);
this.labelRestoreSource.TabIndex = 22;
this.labelRestoreSource.Text = "*Source:";
//
// btnRestoreBrowseDest
//
this.btnRestoreBrowseDest.Location = new System.Drawing.Point(360, 51);
this.btnRestoreBrowseDest.Name = "btnRestoreBrowseDest";
this.btnRestoreBrowseDest.Size = new System.Drawing.Size(30, 20);
this.btnRestoreBrowseDest.TabIndex = 27;
this.btnRestoreBrowseDest.Text = "...";
this.btnRestoreBrowseDest.UseVisualStyleBackColor = true;
this.btnRestoreBrowseDest.Click += new System.EventHandler(this.btnRestoreDest_Click);
//
// textRestoreSource
//
this.textRestoreSource.Location = new System.Drawing.Point(84, 13);
this.textRestoreSource.Name = "textRestoreSource";
this.textRestoreSource.Size = new System.Drawing.Size(271, 20);
this.textRestoreSource.TabIndex = 23;
this.textRestoreSource.TextChanged += new System.EventHandler(this.textRestoreSource_TextChanged);
//
// btnRestoreBrowseSource
//
this.btnRestoreBrowseSource.Location = new System.Drawing.Point(360, 13);
this.btnRestoreBrowseSource.Name = "btnRestoreBrowseSource";
this.btnRestoreBrowseSource.Size = new System.Drawing.Size(30, 20);
this.btnRestoreBrowseSource.TabIndex = 26;
this.btnRestoreBrowseSource.Text = "...";
this.btnRestoreBrowseSource.UseVisualStyleBackColor = true;
this.btnRestoreBrowseSource.Click += new System.EventHandler(this.btnRestoreSource_Click);
//
// labelRestoreDest
//
this.labelRestoreDest.AutoSize = true;
this.labelRestoreDest.Location = new System.Drawing.Point(7, 54);
this.labelRestoreDest.Name = "labelRestoreDest";
this.labelRestoreDest.Size = new System.Drawing.Size(67, 13);
this.labelRestoreDest.TabIndex = 24;
this.labelRestoreDest.Text = "*Destination:";
//
// textRestoreDest
//
this.textRestoreDest.Location = new System.Drawing.Point(84, 51);
this.textRestoreDest.Name = "textRestoreDest";
this.textRestoreDest.Size = new System.Drawing.Size(270, 20);
this.textRestoreDest.TabIndex = 25;
this.textRestoreDest.TextChanged += new System.EventHandler(this.textRestoreDest_TextChanged);
//
// labelDescription
//
this.labelDescription.AutoSize = true;
this.labelDescription.Location = new System.Drawing.Point(24, 35);
this.labelDescription.Name = "labelDescription";
this.labelDescription.Size = new System.Drawing.Size(63, 13);
this.labelDescription.TabIndex = 18;
this.labelDescription.Text = "Description:";
//
// textDescription
//
this.textDescription.Location = new System.Drawing.Point(101, 32);
this.textDescription.Name = "textDescription";
this.textDescription.Size = new System.Drawing.Size(311, 20);
this.textDescription.TabIndex = 0;
this.textDescription.TextChanged += new System.EventHandler(this.textDescription_TextChanged);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.aboutToolStripMenuItem,
this.registerToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(434, 24);
this.menuStrip1.TabIndex = 22;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.toolStripSeparator1,
this.openToolStripMenuItem,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.toolStripSeparator2,
this.websiteToolStripMenuItem,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Text = "Open...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Enabled = false;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
//
// websiteToolStripMenuItem
//
this.websiteToolStripMenuItem.Name = "websiteToolStripMenuItem";
this.websiteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.websiteToolStripMenuItem.Text = "Website...";
this.websiteToolStripMenuItem.Click += new System.EventHandler(this.websiteToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// registerToolStripMenuItem
//
this.registerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.enterDonationKeyToolStripMenuItem,
this.donateToolStripMenuItem});
this.registerToolStripMenuItem.Name = "registerToolStripMenuItem";
this.registerToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.registerToolStripMenuItem.Text = "Register";
//
// enterDonationKeyToolStripMenuItem
//
this.enterDonationKeyToolStripMenuItem.Name = "enterDonationKeyToolStripMenuItem";
this.enterDonationKeyToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
this.enterDonationKeyToolStripMenuItem.Text = "Enter donation key...";
this.enterDonationKeyToolStripMenuItem.Click += new System.EventHandler(this.enterDonationKeyToolStripMenuItem_Click);
//
// donateToolStripMenuItem
//
this.donateToolStripMenuItem.Name = "donateToolStripMenuItem";
this.donateToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
this.donateToolStripMenuItem.Text = "Donate...";
this.donateToolStripMenuItem.Click += new System.EventHandler(this.donateToolStripMenuItem_Click);
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveAsToolStripMenuItem.Text = "Save As...";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
//
// MainWindow
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(434, 316);
this.Controls.Add(this.labelDescription);
this.Controls.Add(this.textDescription);
this.Controls.Add(this.tabControl);
this.Controls.Add(this.statusStrip);
this.Controls.Add(this.menuStrip1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MaximizeBox = false;
this.Name = "MainWindow";
this.Text = "MicronSync";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainWindow_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainWindow_DragEnter);
this.groupRestoreOptions.ResumeLayout(false);
this.groupRestoreOptions.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.tabControl.ResumeLayout(false);
this.tabBackup.ResumeLayout(false);
this.tabBackup.PerformLayout();
this.groupBackupOptions.ResumeLayout(false);
this.groupBackupOptions.PerformLayout();
this.tabRestore.ResumeLayout(false);
this.tabRestore.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupRestoreOptions;
private System.Windows.Forms.TrackBar trackBar;
private System.Windows.Forms.Label labelCompressionLevel;
private System.Windows.Forms.CheckBox chkPurge;
private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.CheckBox chkBackup;
private System.Windows.Forms.Button btnRestore;
private System.Windows.Forms.Button btnBackup;
private System.Windows.Forms.Label labelSyncDate;
private System.Windows.Forms.Label labelBackupDate;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatus;
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.TabPage tabBackup;
private System.Windows.Forms.Label labelDescription;
private System.Windows.Forms.TextBox textDescription;
private System.Windows.Forms.Label labelBackupSource;
private System.Windows.Forms.Button btnBackupBrowseDest;
private System.Windows.Forms.TextBox textBackupSource;
private System.Windows.Forms.Button btnBackupBrowseSource;
private System.Windows.Forms.Label labelBackupDest;
private System.Windows.Forms.TextBox textBackupDest;
private System.Windows.Forms.TabPage tabRestore;
private System.Windows.Forms.Label labelRestoreSource;
private System.Windows.Forms.Button btnRestoreBrowseDest;
private System.Windows.Forms.TextBox textRestoreSource;
private System.Windows.Forms.Button btnRestoreBrowseSource;
private System.Windows.Forms.Label labelRestoreDest;
private System.Windows.Forms.TextBox textRestoreDest;
private System.Windows.Forms.GroupBox groupBackupOptions;
private System.Windows.Forms.ToolStripStatusLabel statusLabel;
private System.Windows.Forms.Label labelMaxCompression;
private System.Windows.Forms.Label labelNoCompression;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.Label labelLastBackup;
private System.Windows.Forms.Label labelLastChange;
private System.Windows.Forms.ToolStripMenuItem registerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enterDonationKeyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem donateToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem websiteToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
}
}
+684
View File
@@ -0,0 +1,684 @@
using MicronSync.Components;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
namespace MicronSync
{
public partial class MainWindow : Form
{
public static MSConfig _MSConfig = new MSConfig();
public static string[] args { get; set; }
private readonly CommonIO _CommonIO = new CommonIO();
private readonly ParseUserInput _ParseUserInput = new ParseUserInput();
private bool isLoading = false;
public MainWindow()
{
InitializeComponent();
}
#region Startup events
private void Form1_Load(object sender, EventArgs e)
{
if (PerformDependencyChecks() > 0)
Environment.Exit(1);
CreateTooltips();
ProcessLicence();
ProcessArgs(args);
}
private void ProcessArgs(string[] args)
{
List<string> listArgs = new List<string>();
if (args.Length > 0)
{
foreach (var item in args)
{
listArgs.Add(" " + item);
}
string fullPath = String.Join(String.Empty, listArgs.ToArray())
.TrimStart()
.TrimEnd();
OpenConfig(false, fullPath);
}
}
/// <summary>
/// Retrieves licence status and displays relevant licencing form.
/// </summary>
private void ProcessLicence()
{
Licencer _Licencer = new Licencer();
//Debug.WriteLine("DEBUG New key: " + _Licencer.CreateNewKey());
Licencer.isRegistered = _Licencer.CheckForExistingLicence();
if (!Licencer.isRegistered)
_Licencer.ShowDonationPrompt();
RemoveRegInfoMenubar(Licencer.isRegistered);
}
/// <summary>
/// Initialize tooltips object and set tooltips for specified UI objects.
/// </summary>
private void CreateTooltips()
{
toolTip.AutomaticDelay = 5000;
toolTip.InitialDelay = 1000;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(labelDescription, "Enter a description of your choice here.");
toolTip.SetToolTip(labelBackupSource, "Select a directory to backup.");
toolTip.SetToolTip(labelBackupDest, "Select a location to store the backup file.");
toolTip.SetToolTip(labelRestoreSource, "Select the backup file to restore from.");
toolTip.SetToolTip(labelRestoreDest, "Select a directory to restore to.");
toolTip.SetToolTip(labelCompressionLevel, "Set a compression value below:\n" +
"Higher levels of compression will require more time for your computer to process,\n" +
"this will result in a smaller output file.");
toolTip.SetToolTip(chkPurge, "This will COMPLETELY wipe clean the restore destination directory\n" +
"prior to restoring from the selected backup.");
toolTip.SetToolTip(chkBackup, "Enabling this option will create a backup of the restoration directory\n" +
"with the extension \".Backup\".");
}
#endregion
/// <summary>
/// Open an existing configuration file.
/// </summary>
/// <param name="file"></param>
/// <param name="useFileSelector"></param>
private void OpenConfig(bool useFileSelector, string file)
{
isLoading = true;
///
string loadedFile;
// Load file selector if a file has already been specified.
if (useFileSelector)
loadedFile = _CommonIO.OpenFile(null, CommonIO.FileType.ini);
else
loadedFile = file;
if (loadedFile.EndsWith(".ini"))
{
_MSConfig = new MSConfig();
_MSConfig.openFile = loadedFile;
_MSConfig.Load();
UpdateWithConfig();
// Set titlebar name.
UpdateTitlebar = loadedFile;
saveToolStripMenuItem.Enabled = true;
}
else
{ MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile, null); }
///
isLoading = false;
}
/// <summary>
/// Syncronises form with data with configuration.
/// </summary>
private void UpdateWithConfig()
{
UpdateTitlebar = _MSConfig.openFile;
textDescription.Text = _MSConfig.Description;
textBackupSource.Text = _MSConfig.BackupSource;
textBackupDest.Text = _MSConfig.BackupDestination;
textRestoreSource.Text = _MSConfig.RestoreSource;
textRestoreDest.Text = _MSConfig.RestoreDestination;
trackBar.Value = _MSConfig.CompressionLevel;
chkBackup.Checked = _MSConfig.EnableBackup;
chkPurge.Checked = _MSConfig.EnablePurge;
}
/// <summary>
/// Checks 7-Zip is installed on system before attempting to continue running program.
/// </summary>
/// <returns>Return error code.</returns>
private int PerformDependencyChecks()
{
int errors = 0;
bool isSysArch64;
// Determine system architecture.
try
{
if (IntPtr.Size == 8)
{
// x64
isSysArch64 = true;
Debug.Write("DEBUG: 64-bit system detected\n");
}
else
{
// x32
isSysArch64 = false;
Debug.Write("DEBUG: 32-bit system detected\n");
}
}
catch (Exception) { throw; }
// Check 7-zip is installed on system.
string sevenZipRegPath = @"SOFTWARE\7-Zip\";
string sevenZipRegValueName = "Path";
try
{
if (isSysArch64 == true)
{
// x64
var regPath64 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
var regKey64 = regPath64?.OpenSubKey(sevenZipRegPath);
var value64 = regKey64?.GetValue(sevenZipRegValueName);
if (File.Exists(value64 + "7z.exe"))
{
LMZAParser.szExePath = value64 + "7z.exe";
LMZAParser.szWorkDir = Convert.ToString(value64);
Debug.Write("DEBUG: 7-Zip exists\n");
}
else
{
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_SZNotInstalled, null);
errors++;
}
}
else
{
// x32
var regPath32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
var regKey32 = regPath32?.OpenSubKey(sevenZipRegPath);
var value32 = regKey32?.GetValue(sevenZipRegValueName);
if (File.Exists(value32 + "7z.exe"))
{
LMZAParser.szExePath = value32 + "7z.exe";
LMZAParser.szWorkDir = Convert.ToString(value32);
Debug.Write("DEBUG: 7-Zip exists\n");
}
else
{
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_SZNotInstalled, null);
errors++;
}
}
}
catch (Exception) { throw; }
return errors;
}
/// <summary>
/// Ensures required fields are not empty before enabling backup button.
/// </summary>
private void BackupButtonQualifier()
{
int count = 0;
if (!string.IsNullOrEmpty(_MSConfig.BackupSource))
count++;
if (!string.IsNullOrEmpty(_MSConfig.BackupDestination))
count++;
if (count == 2)
{
btnBackup.Enabled = true;
UpdateStatus = "Ready";
}
else
{
btnBackup.Enabled = false;
UpdateStatus = "Please fill in the required fields";
}
}
/// <summary>
/// Ensures required fields are not empty before enabling restore button.
/// </summary>
private void RestoreButtonQualifier()
{
int count = 0;
if (!string.IsNullOrEmpty(_MSConfig.RestoreSource))
count++;
if (!string.IsNullOrEmpty(_MSConfig.RestoreDestination))
count++;
if (count == 2)
{
btnRestore.Enabled = true;
UpdateStatus = "Ready";
}
else
{
btnRestore.Enabled = false;
UpdateStatus = "Please fill in the required fields";
}
}
/// <summary>
/// Reports back status of job from WorkerUI instance.
/// </summary>
/// <param name="wui">Instance to pull status from</param>
private void ReportPostJobStatus(WorkerUI wui)
{
// Show Errors:
switch (wui._endResultLMZA)
{
case LMZAParser.endResult.MakePackage_Aborted:
statusLabel.Text = "Aborted backup operation";
break;
case LMZAParser.endResult.ExtractPackage_Aborted:
statusLabel.Text = "Aborted restore operation";
break;
case LMZAParser.endResult.ExtractPackage_Error:
statusLabel.Text = "Restoration failed";
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_RestoreError, null);
break;
case LMZAParser.endResult.MakePackage_Error:
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BackupError, null);
statusLabel.Text = "Backup failed";
break;
case LMZAParser.endResult.Aborted:
break;
case LMZAParser.endResult.Error:
break;
case LMZAParser.endResult.Default:
statusLabel.Text = "Operation successful";
break;
case LMZAParser.endResult.TestArchive_Aborted:
statusLabel.Text = "Aborted test archive operation";
break;
case LMZAParser.endResult.TestArchive_Error:
statusLabel.Text = "Backup verification failed";
break;
default:
break;
}
switch (wui._endResultCIO)
{
case CommonIO.endResult.ClearEntireDirectory_Error:
statusLabel.Text = "Failed to read/write onto filesystem";
break;
case CommonIO.endResult.CopyEntireDirectory_Error:
statusLabel.Text = "Failed to read/write onto filesystem";
break;
case CommonIO.endResult.Default:
break;
case CommonIO.endResult.FileNotExist:
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_ArchiveNotFound, null);
statusLabel.Text = "Failed to locate archive";
break;
default:
break;
}
}
#region UI Functionality
private string UpdateStatus
{
set
{
statusLabel.Text = value;
}
}
private string UpdateTitlebar
{
set
{
if (!string.IsNullOrEmpty(value))
Text = String.Format("MicronSync - {0}", Path.GetFileName(value));
else
Text = String.Format("MicronSync");
}
}
/// <summary>
/// Removes registration entry from menu if registered.
/// </summary>
/// <param name="isLicenced"></param>
private void RemoveRegInfoMenubar(bool isLicenced)
{
if (isLicenced)
menuStrip1.Items.RemoveByKey("registerToolStripMenuItem");
}
private void PromptSaveChanges()
{
DialogResult result;
if (!string.IsNullOrEmpty(_MSConfig.openFile))
{
result = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SaveChanges, _MSConfig.openFile);
if (result == DialogResult.Yes)
_MSConfig.Save();
}
}
#region Form
private void textDescription_TextChanged(object sender, EventArgs e)
{
_MSConfig.Description = textDescription.Text;
}
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
{
PromptSaveChanges();
}
private void textBackupSource_TextChanged(object sender, EventArgs e)
{
_MSConfig.BackupSource = textBackupSource.Text;
labelSyncDate.Text = _CommonIO.CalculateDirectoryModifyDate(_MSConfig.BackupSource);
BackupButtonQualifier();
}
private void textBackupDest_TextChanged(object sender, EventArgs e)
{
_MSConfig.BackupDestination = textBackupDest.Text;
BackupButtonQualifier();
}
private void textRestoreSource_TextChanged(object sender, EventArgs e)
{
_MSConfig.RestoreSource = textRestoreSource.Text;
labelBackupDate.Text = _CommonIO.CalculateFileModifyDate(_MSConfig.RestoreSource);
RestoreButtonQualifier();
}
private void textRestoreDest_TextChanged(object sender, EventArgs e)
{
_MSConfig.RestoreDestination = textRestoreDest.Text;
RestoreButtonQualifier();
}
private void btnBackupBrowseSource_Click(object sender, EventArgs e)
{
textBackupSource.Text = _CommonIO.BrowseFolder(
textBackupSource.Text);
}
private void btnBackupBrowseDest_Click(object sender, EventArgs e)
{
textBackupDest.Text = _CommonIO.SaveFile(
textBackupDest.Text, CommonIO.FileType.sz);
}
private void btnRestoreSource_Click(object sender, EventArgs e)
{
textRestoreSource.Text = _CommonIO.OpenFile(
textRestoreSource.Text, CommonIO.FileType.sz);
}
private void btnRestoreDest_Click(object sender, EventArgs e)
{
textRestoreDest.Text = _CommonIO.BrowseFolder(
textRestoreDest.Text);
}
private void checkMirrorSrcToDst_CheckedChanged(object sender, EventArgs e)
{
// Warn user prior to enabling functionality if backup is also disabled.
if (!isLoading)
{
DialogResult _dialogResult = DialogResult.None;
if (chkPurge.Checked && !chkBackup.Checked)
if (!string.IsNullOrEmpty(_MSConfig.RestoreDestination))
_dialogResult = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_Warn_Purge,
_MSConfig.RestoreDestination);
else
_dialogResult = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_Warn_Purge_Null,
null);
if (_dialogResult == DialogResult.No)
chkPurge.CheckState = CheckState.Unchecked;
}
_MSConfig.EnablePurge = chkPurge.Checked;
}
private void checkBackup_CheckedChanged(object sender, EventArgs e)
{
_MSConfig.EnableBackup = chkBackup.Checked;
}
private void trackBar_ValueChanged(object sender, EventArgs e)
{
_MSConfig.CompressionLevel = trackBar.Value;
}
private void btnRestore_Click(object sender, EventArgs e)
{
bool errors =
_ParseUserInput.IsAllUserInputValid(
_MSConfig.RestoreSource,
_MSConfig.RestoreDestination,
false);
if (!errors)
{
WorkerUI wui = new WorkerUI();
wui.SetWorkerMode = WorkerUI.WorkerMode.Restore;
wui.ShowDialog();
ReportPostJobStatus(wui);
}
}
private void btnBackup_Click(object sender, EventArgs e)
{
bool errors =
_ParseUserInput.IsAllUserInputValid(
_MSConfig.BackupSource,
_MSConfig.BackupDestination,
true);
if (!errors)
{
WorkerUI wui = new WorkerUI();
wui.SetWorkerMode = WorkerUI.WorkerMode.Backup;
wui.ShowDialog();
ReportPostJobStatus(wui);
}
}
private void MainWindow_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Link;
}
private void MainWindow_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
OpenConfig(false, files[0]);
}
#endregion
#region Menubar
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
saveToolStripMenuItem.Enabled = false;
_MSConfig = new MSConfig();
UpdateWithConfig();
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenConfig(true, null);
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(_MSConfig.openFile))
_MSConfig.Save();
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
string saveFile = _CommonIO.SaveFile(null, CommonIO.FileType.ini);
if (!string.IsNullOrEmpty(saveFile))
{
_MSConfig.openFile = saveFile;
_MSConfig.Save();
}
UpdateTitlebar = saveFile;
saveToolStripMenuItem.Enabled = true;
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
PromptSaveChanges();
Environment.Exit(0);
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox about = new AboutBox();
about.ShowDialog();
}
private void enterDonationKeyToolStripMenuItem_Click(object sender, EventArgs e)
{
NewRegKeyUI regKey = new NewRegKeyUI();
regKey.ShowDialog();
RemoveRegInfoMenubar(Licencer.isRegistered);
}
private void donateToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start(DonationUI.donateUrl);
}
private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start(DonationUI.websiteUrl);
}
#endregion
#endregion
}
public partial class ParseUserInput
{
private readonly string[] restrictedDirs =
{
@"C:\Windows",
@"C:\Program",
@"C:\$Recycle",
@"C:\System Volume Information"
};
private readonly int minPathLength = 4;
private bool IsDirectoryAllowed (string input)
{
int errors = 0;
int position = 0;
foreach (var dir in restrictedDirs)
{
if (input.StartsWith(restrictedDirs[position]))
errors++;
position++;
}
bool result = false;
if (errors == 0)
result = true;
return result;
}
private bool IsDstWithinSrcPath (string src, string dst)
{
bool result = false;
if (dst.StartsWith(src))
result = true;
return result;
}
public bool IsAllUserInputValid(string src, string dst, bool isBackupMode)
{
bool result = false;
// Test directories.
if (!IsDirectoryAllowed(src))
{
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_RestrictedPath,
src);
result = true;
}
else if (!IsDirectoryAllowed(dst))
{
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_RestrictedPath,
dst);
result = true;
}
else if (src.Length < minPathLength ||
dst.Length < minPathLength)
{
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_PathRootInvalid, null);
result = true;
}
else if (IsDstWithinSrcPath(src, dst))
{
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_DstWithinSrc, null);
result = true;
}
// Prompt user to replace backup if one already exists.
if (isBackupMode)
{
if (File.Exists(dst))
{
DialogResult _dialogResult =
MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_Warn_OverwriteFile, dst);
if (_dialogResult == DialogResult.Yes)
{
File.Delete(dst);
result = false;
}
else
result = true;
}
}
return result;
}
}
}
File diff suppressed because it is too large Load Diff
+121
View File
@@ -0,0 +1,121 @@
using System;
using System.IO;
using System.Reflection;
namespace MicronSync
{
/// <summary>
/// Settings to store.
/// </summary>
public class Values
{
[SaveToConfig]
public Version MSVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version;
}
}
[SaveToConfig]
public string Description { get; set; }
[SaveToConfig]
public string BackupSource { get; set; }
[SaveToConfig]
public string BackupDestination { get; set; }
[SaveToConfig]
public string RestoreSource { get; set; }
[SaveToConfig]
public string RestoreDestination { get; set; }
[SaveToConfig]
public bool EnablePurge { get; set; }
[SaveToConfig]
public bool EnableBackup { get; set; }
[SaveToConfig]
public int CompressionLevel { get; set; } = 4;
public string openFile { get; set; }
/// <summary>
/// Flags value to be included in configuration.
/// </summary>
internal class SaveToConfigAttribute : Attribute{}
}
public class MSConfig : Values
{
public int Save()
{
int errors = 0;
try
{
// Delete existing config file.
if (File.Exists(openFile))
File.Delete(openFile);
StreamWriter writer = new StreamWriter(openFile, true);
foreach (var item in GetType().GetProperties())
{
foreach (var attr in item.GetCustomAttributes(true))
{
if (item.GetValue(this) != null && item.CanRead)
writer.WriteLine(String.Format("{0}={1}",item.Name,item.GetValue(this)));
}
}
writer.Close();
}
catch (Exception)
{
MessageHandler.errorMessage(MessageHandler.errCodes.Config_WriteError, null);
errors++;
}
return errors;
}
public int Load()
{
int errors = 0;
try
{
foreach (var item in GetType().GetProperties())
{
foreach (var attr in item.GetCustomAttributes(true))
{
///
string line;
using (StreamReader reader = new StreamReader(openFile, true))
{
while (!string.IsNullOrEmpty(
line = reader.ReadLine()))
{
if (line.StartsWith(item.Name) && item.CanWrite)
{
string readValue = line.ToString().Replace(item.Name, "").TrimStart('=');
item.SetValue(this, Convert.ChangeType(readValue, item.PropertyType));
}
}
}
///
}
}
}
catch (Exception)
{
MessageHandler.errorMessage(MessageHandler.errCodes.Config_ReadError, null);
errors++;
}
return errors;
}
}
}
+203
View File
@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{85713D72-FF1F-47BC-B034-FB20ADF4A84A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MicronSync</RootNamespace>
<AssemblyName>MicronSync</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>0.9.9.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>MicronSync.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>F6E1314BAFECF34F1321DE2C676D9C38A192420A</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>MicronSync_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="SKGL">
<HintPath>.\SKGL.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Components\AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Components\AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="Components\CommonIO.cs" />
<Compile Include="Components\DonationUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Components\DonationUI.Designer.cs">
<DependentUpon>DonationUI.cs</DependentUpon>
</Compile>
<Compile Include="Components\Licencer.cs" />
<Compile Include="Components\LMZAParser.cs" />
<Compile Include="Components\MessageHandler.cs" />
<Compile Include="Components\NewRegKeyUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Components\NewRegKeyUI.Designer.cs">
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
</Compile>
<Compile Include="Components\WorkerUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Components\WorkerUI.Designer.cs">
<DependentUpon>WorkerUI.cs</DependentUpon>
</Compile>
<Compile Include="MainWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainWindow.Designer.cs">
<DependentUpon>MainWindow.cs</DependentUpon>
</Compile>
<Compile Include="ManageCfg.cs" />
<Compile Include="Startup.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Components\AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Components\DonationUI.resx">
<DependentUpon>DonationUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Components\NewRegKeyUI.resx">
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Components\WorkerUI.resx">
<DependentUpon>WorkerUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainWindow.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="MicronSync_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="MicronSync.ico" />
<None Include="SKGL.dll" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

+39
View File
@@ -0,0 +1,39 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MicronSync")]
[assembly: AssemblyDescription("MicronSync is free software and can be used both for personal and business use free of charge. Donations are entirely optional and do not extend or enhance MicronSync's functionality in any way.This software also uses 7-Zip as a backend, let the developers know how good their compression technology is!")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Rebound Software")]
[assembly: AssemblyProduct("MicronSync")]
[assembly: AssemblyCopyright("Fil Sapia - Rebound Software (2016)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("85713d72-ff1f-47bc-b034-fb20adf4a84a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en-GB")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <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.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MicronSync.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+120
View File
@@ -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>
+30
View File
@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <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.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
}
}
}
}
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Windows.Forms;
namespace MicronSync
{
static class Startup
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainWindow.args = args;
Application.Run(new MainWindow());
}
}
}
Binary file not shown.
+70
View File
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
Binary file not shown.
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>