├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── Cloning.sln ├── Cloning ├── AboutForm.Designer.cs ├── AboutForm.cs ├── AboutForm.resx ├── Addon.cs ├── App.config ├── ByteSize.cs ├── CloneHelper.Designer.cs ├── CloneHelper.cs ├── CloneHelper.resx ├── Cloning.csproj ├── DriverInfo.cs ├── DriverUtility.cs ├── DriversForm.Designer.cs ├── DriversForm.cs ├── DriversForm.resx ├── EmbeddedAssembly.cs ├── Enums.cs ├── IniFile.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── ManagerForm.Designer.cs ├── ManagerForm.cs ├── ManagerForm.resx ├── MessagerForm.Designer.cs ├── MessagerForm.cs ├── MessagerForm.resx ├── Newtonsoft.Json.dll ├── Options.cs ├── OptionsForm.Designer.cs ├── OptionsForm.cs ├── OptionsForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── SelectorForm.Designer.cs ├── SelectorForm.cs ├── SelectorForm.resx ├── Utilities.cs ├── app.manifest ├── cloning.ico └── packages.config ├── IMAGES.md ├── LICENSE ├── README.md ├── images ├── 1.PNG ├── 2.PNG └── 3.PNG └── version.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Cloning Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [2.0] - 2021-06-07 6 | - Added AnyDesk support (request) 7 | 8 | ## [1.9] - 2017-12-12 9 | - JDownloader2 detection fixed 10 | 11 | ## [1.8] - 2017-02-17 12 | - UI changes 13 | 14 | ## [1.7] - 2016-12-14 15 | - Addressed various issues 16 | 17 | ## [1.6] - 2016-12-05 18 | - Minor bug fixes 19 | 20 | ## [1.5] - 2016-11-24 21 | - Added driver backup support 22 | 23 | ## [1.4] - 2016-10-27 24 | - Major bug fixes 25 | 26 | ## [1.3] - 2016-10-23 27 | - Cosmetic changes 28 | 29 | ## [1.2] - 2016-10-20 30 | - Minor bug fixes 31 | 32 | ## [1.1] - 2016-09-26 33 | - Major bug fixes 34 | 35 | ## [1.0] - 2016-09-16 36 | - Initial release -------------------------------------------------------------------------------- /Cloning.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cloning", "Cloning\Cloning.csproj", "{6B9FD859-DB37-4DD8-86D5-C1600BB659AB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6B9FD859-DB37-4DD8-86D5-C1600BB659AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6B9FD859-DB37-4DD8-86D5-C1600BB659AB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6B9FD859-DB37-4DD8-86D5-C1600BB659AB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6B9FD859-DB37-4DD8-86D5-C1600BB659AB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Cloning/AboutForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cloning 2 | { 3 | partial class AboutForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); 33 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 34 | this.button7 = new System.Windows.Forms.Button(); 35 | this.t1 = new System.Windows.Forms.Timer(this.components); 36 | this.t2 = new System.Windows.Forms.Timer(this.components); 37 | this.l1 = new System.Windows.Forms.Label(); 38 | this.l2 = new System.Windows.Forms.LinkLabel(); 39 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 40 | this.SuspendLayout(); 41 | // 42 | // pictureBox1 43 | // 44 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); 45 | this.pictureBox1.Location = new System.Drawing.Point(12, 12); 46 | this.pictureBox1.Name = "pictureBox1"; 47 | this.pictureBox1.Size = new System.Drawing.Size(110, 108); 48 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 49 | this.pictureBox1.TabIndex = 3; 50 | this.pictureBox1.TabStop = false; 51 | // 52 | // button7 53 | // 54 | this.button7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 55 | this.button7.BackColor = System.Drawing.Color.DodgerBlue; 56 | this.button7.DialogResult = System.Windows.Forms.DialogResult.Cancel; 57 | this.button7.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 58 | this.button7.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 59 | this.button7.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 60 | this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 61 | this.button7.ForeColor = System.Drawing.Color.White; 62 | this.button7.Location = new System.Drawing.Point(383, 12); 63 | this.button7.Name = "button7"; 64 | this.button7.Size = new System.Drawing.Size(89, 39); 65 | this.button7.TabIndex = 37; 66 | this.button7.Tag = "themeable"; 67 | this.button7.Text = "OK"; 68 | this.button7.UseVisualStyleBackColor = false; 69 | this.button7.Click += new System.EventHandler(this.button7_Click); 70 | // 71 | // t1 72 | // 73 | this.t1.Interval = 350; 74 | this.t1.Tick += new System.EventHandler(this.t1_Tick); 75 | // 76 | // t2 77 | // 78 | this.t2.Interval = 350; 79 | this.t2.Tick += new System.EventHandler(this.t2_Tick); 80 | // 81 | // l1 82 | // 83 | this.l1.AutoSize = true; 84 | this.l1.Font = new System.Drawing.Font("Segoe UI Semibold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 85 | this.l1.ForeColor = System.Drawing.Color.White; 86 | this.l1.Location = new System.Drawing.Point(128, 12); 87 | this.l1.Name = "l1"; 88 | this.l1.Size = new System.Drawing.Size(0, 32); 89 | this.l1.TabIndex = 38; 90 | // 91 | // l2 92 | // 93 | this.l2.AutoSize = true; 94 | this.l2.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 95 | this.l2.ForeColor = System.Drawing.Color.DodgerBlue; 96 | this.l2.Location = new System.Drawing.Point(128, 85); 97 | this.l2.Name = "l2"; 98 | this.l2.Size = new System.Drawing.Size(0, 35); 99 | this.l2.TabIndex = 39; 100 | this.l2.Tag = "themeable"; 101 | this.l2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.l2_LinkClicked); 102 | // 103 | // About 104 | // 105 | this.AcceptButton = this.button7; 106 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 107 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 108 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 109 | this.CancelButton = this.button7; 110 | this.ClientSize = new System.Drawing.Size(484, 135); 111 | this.Controls.Add(this.l2); 112 | this.Controls.Add(this.l1); 113 | this.Controls.Add(this.button7); 114 | this.Controls.Add(this.pictureBox1); 115 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 116 | this.ForeColor = System.Drawing.Color.White; 117 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 118 | this.MaximizeBox = false; 119 | this.MinimizeBox = false; 120 | this.Name = "About"; 121 | this.ShowIcon = false; 122 | this.ShowInTaskbar = false; 123 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 124 | this.Text = "About Cloning"; 125 | this.Load += new System.EventHandler(this.About_Load); 126 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 127 | this.ResumeLayout(false); 128 | this.PerformLayout(); 129 | 130 | } 131 | 132 | #endregion 133 | 134 | private System.Windows.Forms.PictureBox pictureBox1; 135 | private System.Windows.Forms.Button button7; 136 | private System.Windows.Forms.Timer t1; 137 | private System.Windows.Forms.Timer t2; 138 | private System.Windows.Forms.Label l1; 139 | private System.Windows.Forms.LinkLabel l2; 140 | } 141 | } -------------------------------------------------------------------------------- /Cloning/AboutForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Diagnostics; 10 | using System.Windows.Forms; 11 | 12 | namespace Cloning 13 | { 14 | public partial class AboutForm : Form 15 | { 16 | public AboutForm() 17 | { 18 | InitializeComponent(); 19 | Options.ApplyTheme(this); 20 | } 21 | 22 | private void About_Load(object sender, EventArgs e) 23 | { 24 | CheckForIllegalCrossThreadCalls = false; 25 | 26 | t1.Interval = 50; 27 | t2.Interval = 50; 28 | 29 | t1.Start(); 30 | } 31 | 32 | private void button7_Click(object sender, EventArgs e) 33 | { 34 | this.Close(); 35 | } 36 | 37 | private void t1_Tick(object sender, EventArgs e) 38 | { 39 | string s0 = ""; 40 | string s1 = "C"; 41 | string s2 = "Cl"; 42 | string s3 = "Clo"; 43 | string s4 = "Clon"; 44 | string s5 = "Cloni"; 45 | string s6 = "Clonin"; 46 | string s7 = "Cloning"; 47 | 48 | switch (l1.Text) 49 | { 50 | case "": 51 | l1.Text = s1; 52 | break; 53 | case "C": 54 | l1.Text = s2; 55 | break; 56 | case "Cl": 57 | l1.Text = s3; 58 | break; 59 | case "Clo": 60 | l1.Text = s4; 61 | break; 62 | case "Clon": 63 | l1.Text = s5; 64 | break; 65 | case "Cloni": 66 | l1.Text = s6; 67 | break; 68 | case "Clonin": 69 | l1.Text = s7; 70 | t1.Stop(); 71 | t2.Start(); 72 | break; 73 | case "Cloning": 74 | l1.Text = s0; 75 | break; 76 | } 77 | } 78 | 79 | private void t2_Tick(object sender, EventArgs e) 80 | { 81 | string s0 = ""; 82 | string s1 = "d"; 83 | string s2 = "de"; 84 | string s3 = "dea"; 85 | string s4 = "dead"; 86 | string s5 = "deadm"; 87 | string s6 = "deadmo"; 88 | string s7 = "deadmoo"; 89 | string s8 = "deadmoon"; 90 | string s9 = "deadmoon © "; 91 | string s10 = "deadmoon © ∞"; 92 | 93 | switch (l2.Text) 94 | { 95 | case "": 96 | l2.Text = s1; 97 | break; 98 | case "d": 99 | l2.Text = s2; 100 | break; 101 | case "de": 102 | l2.Text = s3; 103 | break; 104 | case "dea": 105 | l2.Text = s4; 106 | break; 107 | case "dead": 108 | l2.Text = s5; 109 | break; 110 | case "deadm": 111 | l2.Text = s6; 112 | break; 113 | case "deadmo": 114 | l2.Text = s7; 115 | break; 116 | case "deadmoo": 117 | l2.Text = s8; 118 | break; 119 | case "deadmoon": 120 | l2.Text = s9; 121 | break; 122 | case "deadmoon © ": 123 | l2.Text = s10; 124 | t2.Stop(); 125 | break; 126 | case "deadmoon © ∞": 127 | l2.Text = s0; 128 | break; 129 | } 130 | } 131 | 132 | private void l2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 133 | { 134 | Process.Start("https://github.com/hellzerg/cloning"); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Cloning/AboutForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 | YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAABgBSURBVHhe7ZHtDSy5lhyfk/JCXq0X64AMkEErzEXMYrQv 125 | ePhRJOuwmgHEr+5MJln/uvTzn//r//7XE6m5/AD2/Xuk5vI29nFmyRGXj2DfeIbUX3ZiH2KVHHk5EPue 126 | K+XYyyrs0XfJhMsB2PfbKTMus7BHfksmXZJi3+wNmXN5gj1sBpl3SYR9pwwy79KLPWY2mXp5Gfs2mWTm 127 | pRV7xKwy+fIS9k0yytxLDXu87DL9shH7DifI/IthD3aKXOGyAXv/k+Qal39iD3WaXOWyGHv7k+Qal7+x 128 | R5oh9Yr9f4bUXxZhb/5UqotY5qlUX+xxRqWyG+salcrLAuy9R6WyG+salcrfxh6mV6qmYP29UnWZiL3z 129 | iN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z8VqmYgvVHEtuLDWmR+HZsS4vEp2D9JYl8Artfi8S3 155 | YjtapeIx1h1JbB82okXir2GbWiT+GOsuSeR47G4tEn8F29Mi8cdYdySxfdiIFom/hm1qkfhjrLskkeOx 156 | u9Uk+iq2q0Xij7DeSGL7sBE1ib6ObatJ9DHWXZLI0di9ahJNge2rSfQR1htJbA82oCbRNNjGmkQfYb0l 157 | iRyN3asm0TTYxkhij7DeSGJ7sAE1iabBNtYk+gjrLUnkaOxekcRSYTtrEh3GOiOJ7cEGRBJLh22NJPYI 158 | 6y1J5FjsTjWJpsO2RhIbxjojia3HDq9JNB22tSbRYayzJJFjsTtFEkuJ7Y0kNox1RhJbjx0eSSwttjmS 159 | 2DDWWZLIsdidIomlxPbWJDqE9UUSW48dHkksLbb5+o58krTY5khiQ1hfJLH12OGRxNJim6/75XOkxnZH 160 | EhvC+iKJrccOL0kkPbb9ulc+RWpsdySxIawvkth67PCSRNJj26975VOkxnZHEhvC+iKJrccOL0kkPbb9 161 | ulc+RWpsdySxIawvkth67PCSRNJj26975VOkx7aXJDKE9UUSW48dXpJIemz7da98ivTY9pJEhrC+SGLr 162 | scNLEkmPbb/ulU+RGtsdSWwI64skth47vCSR9Nj26175FKmx3ZHEhrC+SGLrscNLEkmPbb/ulU+RGtsd 163 | SWwI64skth47PJJYWmzzdb98jtTY7khiQ1hfJLH12OGRxNJim6/vyCdJi22OJDaE9UUSW48dHkksLbY5 164 | ktgw1lmSyLHYnSKJpcT21iQ6hPVFEluPHV6TaDpsa02iw1hnSSLHYneKJJYS2xtJbBjrjCS2BxsQSSwd 165 | tjWS2COstySRY7E71SSaDtsaSWwY64wktgcbUJNoGmxjTaKPsN6SRI7G7hVJLBW2sybRYawzktgebEBN 166 | ommwjTWJPsJ6SxI5GrtXTaJpsI2RxB5hvZHE9mEjahJ9HdtWk+hjrLskkaOxe9UkmgLbV5PoI6w3ktg+ 167 | bESLxF/DNrVI/DHWXZLI8djdahJ9FdvVIvFHWG8ksX3YiBaJ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Yk+i3sojWJpsO21iR6acDeL5JY 219 | SmxvJLFvYheOJJYO2xpJ7NKIvWFNoumwrZHEvolduCbRNNjGmkQvHdg7RhJLhe2sSfSb2IVrEk2DbaxJ 220 | 9NKBvWNNommwjZHEvo1dvCbR17FtNYleOrG3rEk0BbavJtFvYxdvkfhr2KYWiV8GsPesSfRVbFeLxL+N 221 | XbxF4q9hm1okfhnA3rNF4q9ge1ok/hvYA7RIfDu2pUXilwfYu7ZIfCu2o1UqfgN7gFap2IZtaJWKywPs 222 | XVulYgt2fqtU/Bb2ED1Ssww7s0dqLhOw922ViqXYuT1S83vYY/RIzXTsrB6puUzC3rhXqqZjZ/VIzW9i 223 | DzIidY+x7hGpu0zE3rlXqqZg/b1S9dvYw4xKZTfWNSqVlwXYe49KZTfWNSqVF3ucp1JdxDJPpfqyCHvz 224 | GVKv2P9nSP3lb+yRTpJrXBZjb3+aXOXyT+yhTpJrXDZg73+KXOFi2IOdIPMvG7HvkF2mX2rY42WUuZeX 225 | sG+SVSZfWrFHzCQzLy9j3yabTL30Yo+ZQeZdEmHfKYPMuzzBHvYNmXNJin2zt2TSZRb2yDtlxuUA7Pvt 226 | kgmXVdijr5RjLwdi33OVHHnZiX2IGVJ/+Qj2jWfJEZe3sY/TIzWXH8C+f4/UXJr517/+Hx6YWTsGH7lx 227 | AAAAAElFTkSuQmCC 228 | 229 | 230 | 231 | 188, 17 232 | 233 | 234 | 258, 17 235 | 236 | -------------------------------------------------------------------------------- /Cloning/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Cloning/ByteSize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | namespace Cloning 5 | { 6 | public struct ByteSize : IComparable, IEquatable 7 | { 8 | public static readonly ByteSize MinValue = ByteSize.FromBits(0); 9 | public static readonly ByteSize MaxValue = ByteSize.FromBits(long.MaxValue); 10 | 11 | public const long BitsInByte = 8; 12 | public const long BytesInKiloByte = 1024; 13 | public const long BytesInMegaByte = 1048576; 14 | public const long BytesInGigaByte = 1073741824; 15 | public const long BytesInTeraByte = 1099511627776; 16 | public const long BytesInPetaByte = 1125899906842624; 17 | 18 | public const string BitSymbol = "b"; 19 | public const string ByteSymbol = "B"; 20 | public const string KiloByteSymbol = "KB"; 21 | public const string MegaByteSymbol = "MB"; 22 | public const string GigaByteSymbol = "GB"; 23 | public const string TeraByteSymbol = "TB"; 24 | public const string PetaByteSymbol = "PB"; 25 | 26 | public long Bits { get; private set; } 27 | public double Bytes { get; private set; } 28 | public double KiloBytes { get; private set; } 29 | public double MegaBytes { get; private set; } 30 | public double GigaBytes { get; private set; } 31 | public double TeraBytes { get; private set; } 32 | public double PetaBytes { get; private set; } 33 | 34 | public string LargestWholeNumberSymbol 35 | { 36 | get 37 | { 38 | // Absolute value is used to deal with negative values 39 | if (Math.Abs(this.PetaBytes) >= 1) 40 | return ByteSize.PetaByteSymbol; 41 | 42 | if (Math.Abs(this.TeraBytes) >= 1) 43 | return ByteSize.TeraByteSymbol; 44 | 45 | if (Math.Abs(this.GigaBytes) >= 1) 46 | return ByteSize.GigaByteSymbol; 47 | 48 | if (Math.Abs(this.MegaBytes) >= 1) 49 | return ByteSize.MegaByteSymbol; 50 | 51 | if (Math.Abs(this.KiloBytes) >= 1) 52 | return ByteSize.KiloByteSymbol; 53 | 54 | if (Math.Abs(this.Bytes) >= 1) 55 | return ByteSize.ByteSymbol; 56 | 57 | return ByteSize.BitSymbol; 58 | } 59 | } 60 | 61 | public double LargestWholeNumberValue 62 | { 63 | get 64 | { 65 | // Absolute value is used to deal with negative values 66 | if (Math.Abs(this.PetaBytes) >= 1) 67 | return this.PetaBytes; 68 | 69 | if (Math.Abs(this.TeraBytes) >= 1) 70 | return this.TeraBytes; 71 | 72 | if (Math.Abs(this.GigaBytes) >= 1) 73 | return this.GigaBytes; 74 | 75 | if (Math.Abs(this.MegaBytes) >= 1) 76 | return this.MegaBytes; 77 | 78 | if (Math.Abs(this.KiloBytes) >= 1) 79 | return this.KiloBytes; 80 | 81 | if (Math.Abs(this.Bytes) >= 1) 82 | return this.Bytes; 83 | 84 | return this.Bits; 85 | } 86 | } 87 | 88 | public ByteSize(double byteSize) 89 | : this() 90 | { 91 | // Get ceiling because bis are whole units 92 | Bits = (long)Math.Ceiling(byteSize * BitsInByte); 93 | 94 | Bytes = byteSize; 95 | KiloBytes = byteSize / BytesInKiloByte; 96 | MegaBytes = byteSize / BytesInMegaByte; 97 | GigaBytes = byteSize / BytesInGigaByte; 98 | TeraBytes = byteSize / BytesInTeraByte; 99 | PetaBytes = byteSize / BytesInPetaByte; 100 | } 101 | 102 | public static ByteSize FromBits(long value) 103 | { 104 | return new ByteSize(value / (double)BitsInByte); 105 | } 106 | 107 | public static ByteSize FromBytes(double value) 108 | { 109 | return new ByteSize(value); 110 | } 111 | 112 | public static ByteSize FromKiloBytes(double value) 113 | { 114 | return new ByteSize(value * BytesInKiloByte); 115 | } 116 | 117 | public static ByteSize FromMegaBytes(double value) 118 | { 119 | return new ByteSize(value * BytesInMegaByte); 120 | } 121 | 122 | public static ByteSize FromGigaBytes(double value) 123 | { 124 | return new ByteSize(value * BytesInGigaByte); 125 | } 126 | 127 | public static ByteSize FromTeraBytes(double value) 128 | { 129 | return new ByteSize(value * BytesInTeraByte); 130 | } 131 | 132 | public static ByteSize FromPetaBytes(double value) 133 | { 134 | return new ByteSize(value * BytesInPetaByte); 135 | } 136 | 137 | /// 138 | /// Converts the value of the current ByteSize object to a string. 139 | /// The metric prefix symbol (bit, byte, kilo, mega, giga, tera) used is 140 | /// the largest metric prefix such that the corresponding value is greater 141 | // than or equal to one. 142 | /// 143 | public override string ToString() 144 | { 145 | return this.ToString("#.##", CultureInfo.CurrentCulture); 146 | } 147 | 148 | public string ToString(string format) 149 | { 150 | return this.ToString(format, CultureInfo.CurrentCulture); 151 | } 152 | 153 | public string ToString(string format, IFormatProvider provider) 154 | { 155 | if (!format.Contains("#") && !format.Contains("0")) 156 | format = "#.## " + format; 157 | 158 | if (provider == null) provider = CultureInfo.CurrentCulture; 159 | 160 | Func has = s => format.IndexOf(s, StringComparison.CurrentCultureIgnoreCase) != -1; 161 | Func output = n => n.ToString(format, provider); 162 | 163 | if (has("PB")) 164 | return output(this.PetaBytes); 165 | if (has("TB")) 166 | return output(this.TeraBytes); 167 | if (has("GB")) 168 | return output(this.GigaBytes); 169 | if (has("MB")) 170 | return output(this.MegaBytes); 171 | if (has("KB")) 172 | return output(this.KiloBytes); 173 | 174 | // Byte and Bit symbol must be case-sensitive 175 | if (format.IndexOf(ByteSize.ByteSymbol) != -1) 176 | return output(this.Bytes); 177 | 178 | if (format.IndexOf(ByteSize.BitSymbol) != -1) 179 | return output(this.Bits); 180 | 181 | return string.Format("{0} {1}", this.LargestWholeNumberValue.ToString(format, provider), this.LargestWholeNumberSymbol); 182 | } 183 | 184 | public override bool Equals(object value) 185 | { 186 | if (value == null) 187 | return false; 188 | 189 | ByteSize other; 190 | if (value is ByteSize) 191 | other = (ByteSize)value; 192 | else 193 | return false; 194 | 195 | return Equals(other); 196 | } 197 | 198 | public bool Equals(ByteSize value) 199 | { 200 | return this.Bits == value.Bits; 201 | } 202 | 203 | public override int GetHashCode() 204 | { 205 | return this.Bits.GetHashCode(); 206 | } 207 | 208 | public int CompareTo(ByteSize other) 209 | { 210 | return this.Bits.CompareTo(other.Bits); 211 | } 212 | 213 | public ByteSize Add(ByteSize bs) 214 | { 215 | return new ByteSize(this.Bytes + bs.Bytes); 216 | } 217 | 218 | public ByteSize AddBits(long value) 219 | { 220 | return this + FromBits(value); 221 | } 222 | 223 | public ByteSize AddBytes(double value) 224 | { 225 | return this + ByteSize.FromBytes(value); 226 | } 227 | 228 | public ByteSize AddKiloBytes(double value) 229 | { 230 | return this + ByteSize.FromKiloBytes(value); 231 | } 232 | 233 | public ByteSize AddMegaBytes(double value) 234 | { 235 | return this + ByteSize.FromMegaBytes(value); 236 | } 237 | 238 | public ByteSize AddGigaBytes(double value) 239 | { 240 | return this + ByteSize.FromGigaBytes(value); 241 | } 242 | 243 | public ByteSize AddTeraBytes(double value) 244 | { 245 | return this + ByteSize.FromTeraBytes(value); 246 | } 247 | 248 | public ByteSize AddPetaBytes(double value) 249 | { 250 | return this + ByteSize.FromPetaBytes(value); 251 | } 252 | 253 | public ByteSize Subtract(ByteSize bs) 254 | { 255 | return new ByteSize(this.Bytes - bs.Bytes); 256 | } 257 | 258 | public static ByteSize operator +(ByteSize b1, ByteSize b2) 259 | { 260 | return new ByteSize(b1.Bytes + b2.Bytes); 261 | } 262 | 263 | public static ByteSize operator ++(ByteSize b) 264 | { 265 | return new ByteSize(b.Bytes + 1); 266 | } 267 | 268 | public static ByteSize operator -(ByteSize b) 269 | { 270 | return new ByteSize(-b.Bytes); 271 | } 272 | 273 | public static ByteSize operator --(ByteSize b) 274 | { 275 | return new ByteSize(b.Bytes - 1); 276 | } 277 | 278 | public static bool operator ==(ByteSize b1, ByteSize b2) 279 | { 280 | return b1.Bits == b2.Bits; 281 | } 282 | 283 | public static bool operator !=(ByteSize b1, ByteSize b2) 284 | { 285 | return b1.Bits != b2.Bits; 286 | } 287 | 288 | public static bool operator <(ByteSize b1, ByteSize b2) 289 | { 290 | return b1.Bits < b2.Bits; 291 | } 292 | 293 | public static bool operator <=(ByteSize b1, ByteSize b2) 294 | { 295 | return b1.Bits <= b2.Bits; 296 | } 297 | 298 | public static bool operator >(ByteSize b1, ByteSize b2) 299 | { 300 | return b1.Bits > b2.Bits; 301 | } 302 | 303 | public static bool operator >=(ByteSize b1, ByteSize b2) 304 | { 305 | return b1.Bits >= b2.Bits; 306 | } 307 | 308 | public static bool TryParse(string s, out ByteSize result) 309 | { 310 | // Arg checking 311 | if (string.IsNullOrWhiteSpace(s)) 312 | throw new ArgumentNullException("s", "String is null or whitespace"); 313 | 314 | // Setup the result 315 | result = new ByteSize(); 316 | 317 | // Get the index of the first non-digit character 318 | s = s.TrimStart(); // Protect against leading spaces 319 | 320 | var num = 0; 321 | var found = false; 322 | 323 | var decimalSeparator = Convert.ToChar(NumberFormatInfo.CurrentInfo.NumberDecimalSeparator); 324 | var groupSeparator = Convert.ToChar(NumberFormatInfo.CurrentInfo.NumberGroupSeparator); 325 | 326 | // Pick first non-digit number 327 | for (num = 0; num < s.Length; num++) 328 | if (!(char.IsDigit(s[num]) || s[num] == decimalSeparator || s[num] == groupSeparator)) 329 | { 330 | found = true; 331 | break; 332 | } 333 | 334 | if (found == false) 335 | return false; 336 | 337 | int lastNumber = num; 338 | 339 | // Cut the input string in half 340 | string numberPart = s.Substring(0, lastNumber).Trim(); 341 | string sizePart = s.Substring(lastNumber, s.Length - lastNumber).Trim(); 342 | 343 | // Get the numeric part 344 | double number; 345 | if (!double.TryParse(numberPart, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.CurrentInfo, out number)) 346 | return false; 347 | 348 | // Get the magnitude part 349 | switch (sizePart) 350 | { 351 | case "b": 352 | if (number % 1 != 0) // Can't have partial bits 353 | return false; 354 | 355 | result = FromBits((long)number); 356 | break; 357 | 358 | case "B": 359 | result = FromBytes(number); 360 | break; 361 | 362 | case "KB": 363 | case "kB": 364 | case "kb": 365 | result = FromKiloBytes(number); 366 | break; 367 | 368 | case "MB": 369 | case "mB": 370 | case "mb": 371 | result = FromMegaBytes(number); 372 | break; 373 | 374 | case "GB": 375 | case "gB": 376 | case "gb": 377 | result = FromGigaBytes(number); 378 | break; 379 | 380 | case "TB": 381 | case "tB": 382 | case "tb": 383 | result = FromTeraBytes(number); 384 | break; 385 | 386 | case "PB": 387 | case "pB": 388 | case "pb": 389 | result = FromPetaBytes(number); 390 | break; 391 | } 392 | 393 | return true; 394 | } 395 | 396 | public static ByteSize Parse(string s) 397 | { 398 | ByteSize result; 399 | 400 | if (TryParse(s, out result)) 401 | return result; 402 | 403 | throw new FormatException("Value is not in the correct format"); 404 | } 405 | } 406 | } 407 | -------------------------------------------------------------------------------- /Cloning/CloneHelper.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cloning 2 | { 3 | partial class CloneHelper 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.label2 = new System.Windows.Forms.Label(); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.dotter = new System.Windows.Forms.Timer(this.components); 35 | this.SuspendLayout(); 36 | // 37 | // label2 38 | // 39 | this.label2.AutoSize = true; 40 | this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 19F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(161))); 41 | this.label2.ForeColor = System.Drawing.Color.White; 42 | this.label2.Location = new System.Drawing.Point(149, 50); 43 | this.label2.Name = "label2"; 44 | this.label2.Size = new System.Drawing.Size(44, 45); 45 | this.label2.TabIndex = 3; 46 | this.label2.Text = "..."; 47 | // 48 | // label1 49 | // 50 | this.label1.AutoSize = true; 51 | this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(161))); 52 | this.label1.ForeColor = System.Drawing.Color.White; 53 | this.label1.Location = new System.Drawing.Point(37, 15); 54 | this.label1.Name = "label1"; 55 | this.label1.Size = new System.Drawing.Size(259, 35); 56 | this.label1.TabIndex = 2; 57 | this.label1.Tag = "themeable"; 58 | this.label1.Text = "Applying, please wait"; 59 | // 60 | // dotter 61 | // 62 | this.dotter.Interval = 500; 63 | this.dotter.Tick += new System.EventHandler(this.dotter_Tick); 64 | // 65 | // CloneHelper 66 | // 67 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 68 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 69 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 70 | this.ClientSize = new System.Drawing.Size(340, 111); 71 | this.ControlBox = false; 72 | this.Controls.Add(this.label2); 73 | this.Controls.Add(this.label1); 74 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 75 | this.ForeColor = System.Drawing.Color.White; 76 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 77 | this.MaximizeBox = false; 78 | this.MinimizeBox = false; 79 | this.Name = "CloneHelper"; 80 | this.ShowIcon = false; 81 | this.ShowInTaskbar = false; 82 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 83 | this.Load += new System.EventHandler(this.CloneHelper_Load); 84 | this.ResumeLayout(false); 85 | this.PerformLayout(); 86 | 87 | } 88 | 89 | #endregion 90 | 91 | private System.Windows.Forms.Label label2; 92 | private System.Windows.Forms.Label label1; 93 | private System.Windows.Forms.Timer dotter; 94 | } 95 | } -------------------------------------------------------------------------------- /Cloning/CloneHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace Cloning 12 | { 13 | public partial class CloneHelper : Form 14 | { 15 | MainForm _Main; 16 | CloneType _Type; 17 | 18 | public CloneHelper(MainForm main, CloneType type) 19 | { 20 | InitializeComponent(); 21 | _Main = main; 22 | _Type = type; 23 | 24 | Options.ApplyTheme(this); 25 | 26 | if (_Type == CloneType.Backup) 27 | { 28 | label1.Text = "Backing up, please wait"; 29 | } 30 | if (_Type == CloneType.Restore) 31 | { 32 | label1.Text = "Restoring, please wait"; 33 | } 34 | } 35 | 36 | private void CloningAnimation() 37 | { 38 | if (_Type == CloneType.Backup) 39 | { 40 | foreach (Addon a in _Main.selectedAddons) 41 | { 42 | a.Backup(_Main.CurrentBackupPath); 43 | } 44 | 45 | this.Close(); 46 | } 47 | if (_Type == CloneType.Restore) 48 | { 49 | foreach (Addon a in _Main.selectedAddons) 50 | { 51 | a.Restore(_Main.CurrentRestorePath); 52 | } 53 | 54 | this.Close(); 55 | } 56 | } 57 | 58 | private void CloneHelper_Load(object sender, EventArgs e) 59 | { 60 | CheckForIllegalCrossThreadCalls = false; 61 | dotter.Start(); 62 | 63 | Task t = new Task(() => CloningAnimation()); 64 | t.Start(); 65 | 66 | this.BringToFront(); 67 | } 68 | 69 | private void dotter_Tick(object sender, EventArgs e) 70 | { 71 | switch (label2.Text) 72 | { 73 | case "": 74 | label2.Text = "."; 75 | break; 76 | case ".": 77 | label2.Text = ".."; 78 | break; 79 | case "..": 80 | label2.Text = "..."; 81 | break; 82 | case "...": 83 | label2.Text = ""; 84 | break; 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Cloning/CloneHelper.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /Cloning/Cloning.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {6B9FD859-DB37-4DD8-86D5-C1600BB659AB} 8 | WinExe 9 | Properties 10 | Cloning 11 | Cloning 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | false 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | false 35 | 36 | 37 | cloning.ico 38 | 39 | 40 | app.manifest 41 | 42 | 43 | 44 | 45 | ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Form 62 | 63 | 64 | AboutForm.cs 65 | 66 | 67 | 68 | 69 | Form 70 | 71 | 72 | CloneHelper.cs 73 | 74 | 75 | 76 | Form 77 | 78 | 79 | DriversForm.cs 80 | 81 | 82 | 83 | 84 | Form 85 | 86 | 87 | ManagerForm.cs 88 | 89 | 90 | Form 91 | 92 | 93 | OptionsForm.cs 94 | 95 | 96 | Form 97 | 98 | 99 | SelectorForm.cs 100 | 101 | 102 | 103 | 104 | 105 | Form 106 | 107 | 108 | MainForm.cs 109 | 110 | 111 | Form 112 | 113 | 114 | MessagerForm.cs 115 | 116 | 117 | 118 | 119 | 120 | AboutForm.cs 121 | 122 | 123 | CloneHelper.cs 124 | 125 | 126 | DriversForm.cs 127 | 128 | 129 | MainForm.cs 130 | 131 | 132 | ManagerForm.cs 133 | 134 | 135 | MessagerForm.cs 136 | 137 | 138 | OptionsForm.cs 139 | 140 | 141 | ResXFileCodeGenerator 142 | Resources.Designer.cs 143 | Designer 144 | 145 | 146 | True 147 | Resources.resx 148 | True 149 | 150 | 151 | SelectorForm.cs 152 | 153 | 154 | 155 | 156 | SettingsSingleFileGenerator 157 | Settings.Designer.cs 158 | 159 | 160 | True 161 | Settings.settings 162 | True 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 180 | -------------------------------------------------------------------------------- /Cloning/DriverInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Cloning 8 | { 9 | public class DriverInfo 10 | { 11 | string driverProvider; 12 | string driverDescription; 13 | string driverDeviceGuid; 14 | string driverID; 15 | 16 | public DriverInfo(string driverProvider, string driverDescription, string driverDeviceGuid, string driverID) 17 | { 18 | this.driverProvider = driverProvider; 19 | this.driverDescription = driverDescription; 20 | this.driverDeviceGuid = driverDeviceGuid; 21 | this.driverID = driverID; 22 | } 23 | 24 | public string DriverProvider 25 | { 26 | get { return this.driverProvider; } 27 | } 28 | 29 | public string DriverDescription 30 | { 31 | get { return this.driverDescription; } 32 | } 33 | 34 | public string DriverDeviceGUID 35 | { 36 | get { return this.driverDeviceGuid; } 37 | } 38 | 39 | public string DriverID 40 | { 41 | get { return this.driverID; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Cloning/DriverUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.IO; 8 | using Microsoft.Win32; 9 | using Microsoft.VisualBasic.FileIO; 10 | using System.Diagnostics; 11 | 12 | namespace Cloning 13 | { 14 | public class DriverUtility 15 | { 16 | string windowsRoot; 17 | string systemRoot; 18 | 19 | public DriverUtility() 20 | { 21 | windowsRoot = Environment.GetEnvironmentVariable("SystemRoot") + "\\"; 22 | systemRoot = windowsRoot + "system32\\"; 23 | } 24 | 25 | public ArrayList ListDrivers(bool showMicrosoft) 26 | { 27 | ArrayList driverList = new ArrayList(); 28 | 29 | RegistryKey regDeviceGUIDs = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Class\\"); 30 | string[] deviceGUIDs = regDeviceGUIDs.GetSubKeyNames(); 31 | 32 | foreach (string deviceGUID in deviceGUIDs) 33 | { 34 | 35 | RegistryKey regDevice = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Class\\" + deviceGUID); 36 | string[] regDeviceSubkeys = regDevice.GetSubKeyNames(); 37 | 38 | foreach (string regDriverNumber in regDeviceSubkeys) 39 | { 40 | string tmpProvider = "", tmpDesc = ""; 41 | try 42 | { 43 | RegistryKey regDriver = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Class\\" + deviceGUID + "\\" + regDriverNumber); 44 | 45 | try 46 | { 47 | tmpDesc = regDriver.GetValue("DriverDesc").ToString(); 48 | tmpProvider = regDriver.GetValue("ProviderName").ToString(); 49 | } 50 | catch { } 51 | 52 | if (tmpProvider.Length > 0 && tmpDesc.Length > 0) 53 | { 54 | if (tmpProvider != "Microsoft") 55 | { 56 | driverList.Add( 57 | new DriverInfo(tmpProvider, tmpDesc, deviceGUID, regDriverNumber) 58 | ); 59 | } 60 | else 61 | { 62 | if (showMicrosoft) 63 | { 64 | driverList.Add( 65 | new DriverInfo(tmpProvider, tmpDesc, deviceGUID, regDriverNumber) 66 | ); 67 | } 68 | } 69 | 70 | } 71 | regDriver.Close(); 72 | } 73 | catch { } 74 | 75 | regDevice.Close(); 76 | } 77 | } 78 | 79 | regDeviceGUIDs.Close(); 80 | 81 | return driverList; 82 | } 83 | 84 | public void BackupDriver(string classGUID, string driverID, string backupLocation) 85 | { 86 | string infFile, infFilePath; 87 | string driverDesc; 88 | 89 | RegistryKey regDriverType = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Class\\" + classGUID); 90 | string driverType = regDriverType.GetValue("Class").ToString(); 91 | 92 | RegistryKey driverInfo = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Class\\" + classGUID + "\\" + driverID); 93 | driverDesc = driverInfo.GetValue("DriverDesc").ToString(); 94 | infFile = driverInfo.GetValue("InfPath").ToString(); 95 | infFilePath = windowsRoot + "inf\\" + infFile.ToString(); 96 | 97 | if (driverType.Length > 0) 98 | { 99 | Directory.CreateDirectory(backupLocation + driverType); 100 | } 101 | Directory.CreateDirectory(backupLocation + driverType + "\\" + driverDesc); 102 | 103 | try 104 | { 105 | FileSystem.CopyFile(infFilePath, backupLocation + driverType + "\\" + driverDesc + "\\" + infFile, UIOption.AllDialogs, UICancelOption.DoNothing); 106 | } 107 | catch { } 108 | 109 | IniFile driverIniFile = new IniFile(); 110 | List driverFiles = driverIniFile.GetKeys(infFilePath, "SourceDisksFiles"); 111 | 112 | foreach (string driverFile in driverFiles) 113 | { 114 | try 115 | { 116 | if (driverFile.Split('.').Length > 1) 117 | { 118 | 119 | if (driverFile.Split('.')[1] == "hlp") 120 | { 121 | FileSystem.CopyFile(windowsRoot + "Help\\" + driverFile, backupLocation + driverType + "\\" + driverDesc + "\\" + driverFile, UIOption.AllDialogs, UICancelOption.DoNothing); 122 | } 123 | else if (driverFile.Split('.')[1] == "sys") 124 | { 125 | FileSystem.CopyFile(systemRoot + "drivers\\" + driverFile, backupLocation + driverType + "\\" + driverDesc + "\\" + driverFile, UIOption.AllDialogs, UICancelOption.DoNothing); 126 | } 127 | else 128 | { 129 | FileSystem.CopyFile(systemRoot + driverFile, backupLocation + driverType + "\\" + driverDesc + "\\" + driverFile, UIOption.AllDialogs, UICancelOption.DoNothing); 130 | } 131 | } 132 | } 133 | catch { } 134 | } 135 | 136 | 137 | regDriverType.Close(); 138 | driverInfo.Close(); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /Cloning/DriversForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cloning 2 | { 3 | partial class DriversForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DriversForm)); 32 | this.DriverList = new System.Windows.Forms.DataGridView(); 33 | this.DriverProvider = new System.Windows.Forms.DataGridViewTextBoxColumn(); 34 | this.DriverDescription = new System.Windows.Forms.DataGridViewTextBoxColumn(); 35 | this.DriverDeviceGUID = new System.Windows.Forms.DataGridViewTextBoxColumn(); 36 | this.DriverID = new System.Windows.Forms.DataGridViewTextBoxColumn(); 37 | this.topPanel = new System.Windows.Forms.Panel(); 38 | this.botPanel = new System.Windows.Forms.Panel(); 39 | this.button1 = new System.Windows.Forms.Button(); 40 | this.checkBox1 = new System.Windows.Forms.CheckBox(); 41 | this.lblSelectedDrivers = new System.Windows.Forms.Label(); 42 | this.label7 = new System.Windows.Forms.Label(); 43 | this.label3 = new System.Windows.Forms.Label(); 44 | this.linkLabel1 = new System.Windows.Forms.LinkLabel(); 45 | this.linkLabel2 = new System.Windows.Forms.LinkLabel(); 46 | ((System.ComponentModel.ISupportInitialize)(this.DriverList)).BeginInit(); 47 | this.topPanel.SuspendLayout(); 48 | this.botPanel.SuspendLayout(); 49 | this.SuspendLayout(); 50 | // 51 | // DriverList 52 | // 53 | this.DriverList.AllowUserToAddRows = false; 54 | this.DriverList.AllowUserToDeleteRows = false; 55 | this.DriverList.AllowUserToResizeRows = false; 56 | this.DriverList.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 57 | this.DriverList.BorderStyle = System.Windows.Forms.BorderStyle.None; 58 | this.DriverList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 59 | this.DriverList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { 60 | this.DriverProvider, 61 | this.DriverDescription, 62 | this.DriverDeviceGUID, 63 | this.DriverID}); 64 | this.DriverList.Dock = System.Windows.Forms.DockStyle.Fill; 65 | this.DriverList.EnableHeadersVisualStyles = false; 66 | this.DriverList.GridColor = System.Drawing.Color.DodgerBlue; 67 | this.DriverList.Location = new System.Drawing.Point(0, 0); 68 | this.DriverList.Name = "DriverList"; 69 | this.DriverList.ReadOnly = true; 70 | this.DriverList.RowHeadersVisible = false; 71 | this.DriverList.RowTemplate.Height = 24; 72 | this.DriverList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; 73 | this.DriverList.Size = new System.Drawing.Size(844, 523); 74 | this.DriverList.TabIndex = 1; 75 | this.DriverList.SelectionChanged += new System.EventHandler(this.DriverList_SelectionChanged); 76 | // 77 | // DriverProvider 78 | // 79 | this.DriverProvider.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; 80 | this.DriverProvider.DataPropertyName = "DriverProvider"; 81 | this.DriverProvider.HeaderText = "PROVIDER:"; 82 | this.DriverProvider.Name = "DriverProvider"; 83 | this.DriverProvider.ReadOnly = true; 84 | this.DriverProvider.Width = 113; 85 | // 86 | // DriverDescription 87 | // 88 | this.DriverDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; 89 | this.DriverDescription.DataPropertyName = "DriverDescription"; 90 | this.DriverDescription.HeaderText = "DESCRIPTION:"; 91 | this.DriverDescription.Name = "DriverDescription"; 92 | this.DriverDescription.ReadOnly = true; 93 | this.DriverDescription.Width = 135; 94 | // 95 | // DriverDeviceGUID 96 | // 97 | this.DriverDeviceGUID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; 98 | this.DriverDeviceGUID.DataPropertyName = "DriverDeviceGUID"; 99 | this.DriverDeviceGUID.HeaderText = "DEVICE GUID:"; 100 | this.DriverDeviceGUID.Name = "DriverDeviceGUID"; 101 | this.DriverDeviceGUID.ReadOnly = true; 102 | this.DriverDeviceGUID.Width = 132; 103 | // 104 | // DriverID 105 | // 106 | this.DriverID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; 107 | this.DriverID.DataPropertyName = "DriverID"; 108 | this.DriverID.HeaderText = "DRIVER ID:"; 109 | this.DriverID.Name = "DriverID"; 110 | this.DriverID.ReadOnly = true; 111 | this.DriverID.Width = 112; 112 | // 113 | // topPanel 114 | // 115 | this.topPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 116 | | System.Windows.Forms.AnchorStyles.Left) 117 | | System.Windows.Forms.AnchorStyles.Right))); 118 | this.topPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 119 | this.topPanel.Controls.Add(this.DriverList); 120 | this.topPanel.Location = new System.Drawing.Point(0, 0); 121 | this.topPanel.Name = "topPanel"; 122 | this.topPanel.Size = new System.Drawing.Size(846, 525); 123 | this.topPanel.TabIndex = 2; 124 | // 125 | // botPanel 126 | // 127 | this.botPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 128 | this.botPanel.Controls.Add(this.button1); 129 | this.botPanel.Controls.Add(this.checkBox1); 130 | this.botPanel.Controls.Add(this.lblSelectedDrivers); 131 | this.botPanel.Controls.Add(this.label7); 132 | this.botPanel.Controls.Add(this.label3); 133 | this.botPanel.Controls.Add(this.linkLabel1); 134 | this.botPanel.Controls.Add(this.linkLabel2); 135 | this.botPanel.Dock = System.Windows.Forms.DockStyle.Bottom; 136 | this.botPanel.Location = new System.Drawing.Point(0, 525); 137 | this.botPanel.Name = "botPanel"; 138 | this.botPanel.Size = new System.Drawing.Size(846, 66); 139 | this.botPanel.TabIndex = 3; 140 | // 141 | // button1 142 | // 143 | this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 144 | this.button1.BackColor = System.Drawing.Color.DodgerBlue; 145 | this.button1.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 146 | this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 147 | this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 148 | this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 149 | this.button1.Location = new System.Drawing.Point(734, 14); 150 | this.button1.Name = "button1"; 151 | this.button1.Size = new System.Drawing.Size(99, 39); 152 | this.button1.TabIndex = 29; 153 | this.button1.Tag = "themeable"; 154 | this.button1.Text = "Backup"; 155 | this.button1.UseVisualStyleBackColor = false; 156 | this.button1.Click += new System.EventHandler(this.button1_Click); 157 | // 158 | // checkBox1 159 | // 160 | this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 161 | this.checkBox1.AutoSize = true; 162 | this.checkBox1.ForeColor = System.Drawing.Color.White; 163 | this.checkBox1.Location = new System.Drawing.Point(540, 22); 164 | this.checkBox1.Name = "checkBox1"; 165 | this.checkBox1.Size = new System.Drawing.Size(188, 24); 166 | this.checkBox1.TabIndex = 28; 167 | this.checkBox1.Text = "Show Microsoft drivers"; 168 | this.checkBox1.UseVisualStyleBackColor = true; 169 | this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); 170 | // 171 | // lblSelectedDrivers 172 | // 173 | this.lblSelectedDrivers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 174 | this.lblSelectedDrivers.AutoSize = true; 175 | this.lblSelectedDrivers.ForeColor = System.Drawing.Color.White; 176 | this.lblSelectedDrivers.Location = new System.Drawing.Point(155, 36); 177 | this.lblSelectedDrivers.Name = "lblSelectedDrivers"; 178 | this.lblSelectedDrivers.Size = new System.Drawing.Size(17, 20); 179 | this.lblSelectedDrivers.TabIndex = 27; 180 | this.lblSelectedDrivers.Text = "0"; 181 | this.lblSelectedDrivers.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 182 | // 183 | // label7 184 | // 185 | this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 186 | this.label7.AutoSize = true; 187 | this.label7.ForeColor = System.Drawing.Color.White; 188 | this.label7.Location = new System.Drawing.Point(11, 36); 189 | this.label7.Name = "label7"; 190 | this.label7.Size = new System.Drawing.Size(121, 20); 191 | this.label7.TabIndex = 26; 192 | this.label7.Text = "Selected drivers:"; 193 | // 194 | // label3 195 | // 196 | this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 197 | this.label3.AutoSize = true; 198 | this.label3.Cursor = System.Windows.Forms.Cursors.Hand; 199 | this.label3.ForeColor = System.Drawing.Color.White; 200 | this.label3.Location = new System.Drawing.Point(77, 7); 201 | this.label3.Name = "label3"; 202 | this.label3.Size = new System.Drawing.Size(13, 20); 203 | this.label3.TabIndex = 23; 204 | this.label3.Text = "|"; 205 | // 206 | // linkLabel1 207 | // 208 | this.linkLabel1.ActiveLinkColor = System.Drawing.Color.RoyalBlue; 209 | this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 210 | this.linkLabel1.AutoSize = true; 211 | this.linkLabel1.LinkColor = System.Drawing.Color.DodgerBlue; 212 | this.linkLabel1.Location = new System.Drawing.Point(86, 7); 213 | this.linkLabel1.Name = "linkLabel1"; 214 | this.linkLabel1.Size = new System.Drawing.Size(86, 20); 215 | this.linkLabel1.TabIndex = 24; 216 | this.linkLabel1.TabStop = true; 217 | this.linkLabel1.Tag = "themeable"; 218 | this.linkLabel1.Text = "Deselect all"; 219 | this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 220 | this.linkLabel1.VisitedLinkColor = System.Drawing.Color.DodgerBlue; 221 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 222 | // 223 | // linkLabel2 224 | // 225 | this.linkLabel2.ActiveLinkColor = System.Drawing.Color.RoyalBlue; 226 | this.linkLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 227 | this.linkLabel2.AutoSize = true; 228 | this.linkLabel2.LinkColor = System.Drawing.Color.DodgerBlue; 229 | this.linkLabel2.Location = new System.Drawing.Point(11, 7); 230 | this.linkLabel2.Name = "linkLabel2"; 231 | this.linkLabel2.Size = new System.Drawing.Size(69, 20); 232 | this.linkLabel2.TabIndex = 25; 233 | this.linkLabel2.TabStop = true; 234 | this.linkLabel2.Tag = "themeable"; 235 | this.linkLabel2.Text = "Select all"; 236 | this.linkLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 237 | this.linkLabel2.VisitedLinkColor = System.Drawing.Color.DodgerBlue; 238 | this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); 239 | // 240 | // DriversForm 241 | // 242 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 243 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 244 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 245 | this.ClientSize = new System.Drawing.Size(846, 591); 246 | this.Controls.Add(this.botPanel); 247 | this.Controls.Add(this.topPanel); 248 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 249 | this.ForeColor = System.Drawing.Color.White; 250 | this.Name = "DriversForm"; 251 | this.ShowIcon = false; 252 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 253 | this.Text = "Drivers"; 254 | this.Load += new System.EventHandler(this.DriversForm_Load); 255 | ((System.ComponentModel.ISupportInitialize)(this.DriverList)).EndInit(); 256 | this.topPanel.ResumeLayout(false); 257 | this.botPanel.ResumeLayout(false); 258 | this.botPanel.PerformLayout(); 259 | this.ResumeLayout(false); 260 | 261 | } 262 | 263 | #endregion 264 | 265 | private System.Windows.Forms.DataGridView DriverList; 266 | private System.Windows.Forms.Panel topPanel; 267 | private System.Windows.Forms.Panel botPanel; 268 | private System.Windows.Forms.Label lblSelectedDrivers; 269 | private System.Windows.Forms.Label label7; 270 | private System.Windows.Forms.Label label3; 271 | private System.Windows.Forms.LinkLabel linkLabel1; 272 | private System.Windows.Forms.LinkLabel linkLabel2; 273 | private System.Windows.Forms.CheckBox checkBox1; 274 | private System.Windows.Forms.Button button1; 275 | private System.Windows.Forms.DataGridViewTextBoxColumn DriverProvider; 276 | private System.Windows.Forms.DataGridViewTextBoxColumn DriverDescription; 277 | private System.Windows.Forms.DataGridViewTextBoxColumn DriverDeviceGUID; 278 | private System.Windows.Forms.DataGridViewTextBoxColumn DriverID; 279 | } 280 | } -------------------------------------------------------------------------------- /Cloning/DriversForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using System.IO; 12 | using System.Diagnostics; 13 | 14 | namespace Cloning 15 | { 16 | public partial class DriversForm : Form 17 | { 18 | readonly string DriverBackupFolder = Application.StartupPath + "\\Drivers\\"; 19 | readonly string Now = (DateTime.Now.ToShortDateString() + " - " + DateTime.Now.ToShortTimeString()).Replace("/", "-").Replace(":", "."); 20 | readonly string ErrorMessage = "An error occured while copying drivers"; 21 | 22 | DriverUtility driverUtility; 23 | 24 | public DriversForm() 25 | { 26 | InitializeComponent(); 27 | Options.ApplyTheme(this); 28 | FixColor(); 29 | driverUtility = new DriverUtility(); 30 | } 31 | 32 | private void DetectDrivers(bool showMicrosoft) 33 | { 34 | DriverList.DataSource = null; 35 | ArrayList al = driverUtility.ListDrivers(showMicrosoft); 36 | DriverList.AutoGenerateColumns = false; 37 | DriverList.DataSource = al; 38 | this.Text = string.Format("Drivers [{0} detected]", al.Count); 39 | } 40 | 41 | private void FixColor() 42 | { 43 | DriverList.GridColor = Options.ForegroundColor; 44 | DriverList.ColumnHeadersDefaultCellStyle.BackColor = Options.BackgroundColor; 45 | DriverList.ColumnHeadersDefaultCellStyle.ForeColor = Options.ForegroundColor; 46 | 47 | foreach (DataGridViewColumn column in DriverList.Columns) 48 | { 49 | column.DefaultCellStyle.BackColor = Options.BackgroundColor; 50 | column.DefaultCellStyle.ForeColor = Options.ForegroundColor; 51 | } 52 | } 53 | 54 | private string Backup() 55 | { 56 | try 57 | { 58 | foreach (DataGridViewRow selectedDriver in DriverList.SelectedRows) 59 | { 60 | string deviceGUID = selectedDriver.Cells[2].Value.ToString(); 61 | string driverID = selectedDriver.Cells[3].Value.ToString(); 62 | 63 | driverUtility.BackupDriver(deviceGUID, driverID, DriverBackupFolder + Now + "\\"); 64 | } 65 | return DriverBackupFolder + Now; 66 | } 67 | catch 68 | { 69 | MessagerForm f = new MessagerForm(null, MessagerType.Info, ErrorMessage); 70 | f.ShowDialog(); 71 | return string.Empty; 72 | } 73 | } 74 | 75 | private void DriversForm_Load(object sender, EventArgs e) 76 | { 77 | DetectDrivers(checkBox1.Checked); 78 | 79 | if (!Directory.Exists(DriverBackupFolder)) 80 | { 81 | Directory.CreateDirectory(DriverBackupFolder); 82 | } 83 | } 84 | 85 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 86 | { 87 | DriverList.SelectAll(); 88 | } 89 | 90 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 91 | { 92 | DriverList.ClearSelection(); 93 | } 94 | 95 | private void checkBox1_CheckedChanged(object sender, EventArgs e) 96 | { 97 | DetectDrivers(checkBox1.Checked); 98 | } 99 | 100 | private void button1_Click(object sender, EventArgs e) 101 | { 102 | Task t = Task.Factory.StartNew(() => Backup()); 103 | 104 | if (!string.IsNullOrEmpty(t.Result)) 105 | { 106 | Process.Start(t.Result); 107 | } 108 | } 109 | 110 | private void DriverList_SelectionChanged(object sender, EventArgs e) 111 | { 112 | lblSelectedDrivers.Text = DriverList.SelectedRows.Count.ToString(); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Cloning/EmbeddedAssembly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Reflection; 5 | using System.Security.Cryptography; 6 | 7 | namespace Cloning 8 | { 9 | public class EmbeddedAssembly 10 | { 11 | private static Dictionary dic; 12 | 13 | public static void Load(string embeddedResource, string fileName) 14 | { 15 | if (dic == null) 16 | dic = new Dictionary(); 17 | 18 | byte[] ba = null; 19 | Assembly asm = null; 20 | var curAsm = Assembly.GetExecutingAssembly(); 21 | 22 | using (var stm = curAsm.GetManifestResourceStream(embeddedResource)) 23 | { 24 | if (stm == null) 25 | throw new Exception(embeddedResource + " is not found in Embedded Resources."); 26 | 27 | ba = new byte[(int)stm.Length]; 28 | stm.Read(ba, 0, (int)stm.Length); 29 | try 30 | { 31 | asm = Assembly.Load(ba); 32 | 33 | dic.Add(asm.FullName, asm); 34 | return; 35 | } 36 | catch { } 37 | } 38 | 39 | var fileOk = false; 40 | var tempFile = ""; 41 | 42 | using (var sha1 = new SHA1CryptoServiceProvider()) 43 | { 44 | var fileHash = BitConverter.ToString(sha1.ComputeHash(ba)).Replace("-", string.Empty); 45 | ; 46 | 47 | tempFile = Path.GetTempPath() + fileName; 48 | 49 | if (File.Exists(tempFile)) 50 | { 51 | var bb = File.ReadAllBytes(tempFile); 52 | var fileHash2 = BitConverter.ToString(sha1.ComputeHash(bb)).Replace("-", string.Empty); 53 | 54 | if (fileHash == fileHash2) 55 | { 56 | fileOk = true; 57 | } 58 | } 59 | else 60 | { 61 | fileOk = false; 62 | } 63 | } 64 | 65 | if (!fileOk) 66 | { 67 | File.WriteAllBytes(tempFile, ba); 68 | } 69 | 70 | asm = Assembly.LoadFile(tempFile); 71 | 72 | dic.Add(asm.FullName, asm); 73 | } 74 | 75 | public static Assembly Get(string assemblyFullName) 76 | { 77 | if (dic == null || dic.Count == 0) 78 | return null; 79 | 80 | if (dic.ContainsKey(assemblyFullName)) 81 | return dic[assemblyFullName]; 82 | 83 | return null; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Cloning/Enums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Cloning 8 | { 9 | public enum CloneType 10 | { 11 | Backup, 12 | Restore 13 | } 14 | 15 | public enum MessagerType 16 | { 17 | Info, 18 | Question 19 | } 20 | 21 | public enum Theme 22 | { 23 | Zerg, 24 | Ocean, 25 | Caramel, 26 | Magma, 27 | Lime, 28 | Minimal 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Cloning/IniFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace Cloning 9 | { 10 | public class IniFile 11 | { 12 | [DllImport("KERNEL32.DLL", EntryPoint = "GetPrivateProfileStringW", 13 | SetLastError = true, 14 | CharSet = CharSet.Unicode, ExactSpelling = true, 15 | CallingConvention = CallingConvention.StdCall)] 16 | 17 | private static extern int GetPrivateProfileString( 18 | string lpAppName, 19 | string lpKeyName, 20 | string lpDefault, 21 | string lpReturnString, 22 | int nSize, 23 | string lpFilename); 24 | 25 | public List GetKeys(string iniFile, string category) 26 | { 27 | string returnString = new string(' ', 32768); 28 | GetPrivateProfileString(category, null, null, returnString, 32768, iniFile); 29 | 30 | List result = new List(returnString.Split('\0')); 31 | result.RemoveRange(result.Count - 2, 2); 32 | return result; 33 | } 34 | 35 | public string GetIniFileString(string iniFile, string category, string key, string defaultValue) 36 | { 37 | string returnString = new string(' ', 1024); 38 | GetPrivateProfileString(category, key, defaultValue, returnString, 1024, iniFile); 39 | 40 | return returnString.Split('\0')[0]; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Cloning/MainForm.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Reflection; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | using System.Windows.Forms; 13 | 14 | namespace Cloning 15 | { 16 | public partial class MainForm : Form 17 | { 18 | internal string CurrentBackupPath = Options.DataFolder + Utilities.NowShort + "\\"; 19 | internal string CurrentRestorePath = ""; 20 | 21 | List addons = new List(); 22 | internal List selectedAddons = new List(); 23 | 24 | SevenZip zip7 = new SevenZip(); 25 | AdobePhotoshop photoshop = new AdobePhotoshop(); 26 | AdobeReader reader = new AdobeReader(); 27 | AnyDesk anydesk = new AnyDesk(); 28 | BitTorrent bt = new BitTorrent(); 29 | BSPlayer bs = new BSPlayer(); 30 | CCleaner cc = new CCleaner(); 31 | ClassicShell cshell = new ClassicShell(); 32 | FileZilla filezilla = new FileZilla(); 33 | Foobar2000 foo = new Foobar2000(); 34 | GoogleChrome chrome = new GoogleChrome(); 35 | IrfanView iview = new IrfanView(); 36 | JDownloader2 jdownloader = new JDownloader2(); 37 | LibreOffice libre = new LibreOffice(); 38 | MalwarebytesAntiMalware malware = new MalwarebytesAntiMalware(); 39 | MaxthonCloudBrowser maxthon = new MaxthonCloudBrowser(); 40 | MozillaFirefox ff = new MozillaFirefox(); 41 | MozillaThunderbird tb = new MozillaThunderbird(); 42 | NotepadPlusPlus npp = new NotepadPlusPlus(); 43 | OpenOffice open = new OpenOffice(); 44 | OperaBrowser opera = new OperaBrowser(); 45 | PuTTY putty = new PuTTY(); 46 | qBitTorrent qbt = new qBitTorrent(); 47 | Skype carcinos = new Skype(); 48 | Speccy speccy = new Speccy(); 49 | Steam steam = new Steam(); 50 | SublimeText sublime = new SublimeText(); 51 | SumatraPDF pdf = new SumatraPDF(); 52 | TeamSpeak ts = new TeamSpeak(); 53 | TeamViewer tv = new TeamViewer(); 54 | TeraCopy teracopy = new TeraCopy(); 55 | uTorrent ut = new uTorrent(); 56 | VivaldiBrowser vivaldi = new VivaldiBrowser(); 57 | VLCMediaPlayer vlc = new VLCMediaPlayer(); 58 | Winamp winamp = new Winamp(); 59 | WinRAR rar = new WinRAR(); 60 | WinZip zip = new WinZip(); 61 | WireShark ws = new WireShark(); 62 | 63 | bool SelectAllFlag = true; 64 | 65 | private string GetOS() 66 | { 67 | return (string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "ProductName", ""); 68 | } 69 | 70 | private string GetBitness() 71 | { 72 | string bitness = ""; 73 | 74 | if (Environment.Is64BitOperatingSystem == true) 75 | { 76 | bitness = "You are working with 64-bit architecture"; 77 | } 78 | else 79 | { 80 | bitness = "You are working with 32-bit architecture"; 81 | } 82 | 83 | return bitness; 84 | } 85 | 86 | public MainForm() 87 | { 88 | InitializeComponent(); 89 | Options.ApplyTheme(this); 90 | } 91 | 92 | private void button1_Click(object sender, EventArgs e) 93 | { 94 | if (applist.CheckedItems.Count > 0) 95 | { 96 | if (!Directory.Exists(CurrentBackupPath)) 97 | { 98 | Directory.CreateDirectory(CurrentBackupPath); 99 | } 100 | 101 | for (int i = 0; i < applist.Items.Count; i++) 102 | { 103 | if (applist.GetItemChecked(i)) 104 | { 105 | selectedAddons.Add(addons[i]); 106 | } 107 | } 108 | 109 | CloneHelper f = new CloneHelper(this, CloneType.Backup); 110 | f.ShowDialog(this); 111 | } 112 | } 113 | 114 | private void InitializeAddons() 115 | { 116 | addons.Add(zip7); 117 | addons.Add(photoshop); 118 | addons.Add(reader); 119 | addons.Add(anydesk); 120 | addons.Add(bt); 121 | addons.Add(bs); 122 | addons.Add(cc); 123 | addons.Add(cshell); 124 | addons.Add(filezilla); 125 | addons.Add(foo); 126 | addons.Add(chrome); 127 | addons.Add(iview); 128 | addons.Add(jdownloader); 129 | addons.Add(libre); 130 | addons.Add(malware); 131 | addons.Add(maxthon); 132 | addons.Add(ff); 133 | addons.Add(tb); 134 | addons.Add(npp); 135 | addons.Add(open); 136 | addons.Add(opera); 137 | addons.Add(putty); 138 | addons.Add(qbt); 139 | addons.Add(carcinos); 140 | addons.Add(speccy); 141 | addons.Add(steam); 142 | addons.Add(sublime); 143 | addons.Add(pdf); 144 | addons.Add(ts); 145 | addons.Add(tv); 146 | addons.Add(teracopy); 147 | addons.Add(ut); 148 | addons.Add(vivaldi); 149 | addons.Add(vlc); 150 | addons.Add(winamp); 151 | addons.Add(rar); 152 | addons.Add(zip); 153 | addons.Add(ws); 154 | } 155 | 156 | private void Main_Load(object sender, EventArgs e) 157 | { 158 | CheckForIllegalCrossThreadCalls = false; 159 | 160 | Program._main = this; 161 | lblversion.Text = "Version: " + Program.GetCurrentVersionToString(); 162 | lblos.Text = "Microsoft " + GetOS(); 163 | lblbitness.Text = GetBitness(); 164 | InitializeAddons(); 165 | 166 | if (applist.Items.Count > 0) 167 | { 168 | applist.SetSelected(0, true); 169 | } 170 | } 171 | 172 | private void pictureBox1_Click(object sender, EventArgs e) 173 | { 174 | AboutForm f = new AboutForm(); 175 | f.ShowDialog(this); 176 | } 177 | 178 | private void applist_SelectedIndexChanged(object sender, EventArgs e) 179 | { 180 | if (applist.SelectedIndices.Count > 0) 181 | { 182 | apptxt.Text = addons[applist.SelectedIndex].Title; 183 | descriptiontxt.Text = addons[applist.SelectedIndex].Info; 184 | versiontxt.Text = addons[applist.SelectedIndex].Version; 185 | } 186 | } 187 | 188 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 189 | { 190 | if (SelectAllFlag) 191 | { 192 | SelectAll(true); 193 | linkLabel1.Text = "Deselect all"; 194 | } 195 | if (!SelectAllFlag) 196 | { 197 | SelectAll(false); 198 | linkLabel1.Text = "Select all"; 199 | } 200 | 201 | SelectAllFlag = !SelectAllFlag; 202 | linkLabel1.Cursor = Cursors.Hand; 203 | } 204 | 205 | private void SelectAll(bool flag) 206 | { 207 | for (int i = 0; i < applist.Items.Count; i++) 208 | { 209 | applist.SetItemChecked(i, flag); 210 | } 211 | } 212 | 213 | private void SelectInstalled() 214 | { 215 | for (int i = 0; i < addons.Count; i++) 216 | { 217 | applist.SetItemChecked(i, addons[i].IsInstalled()); 218 | } 219 | } 220 | 221 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 222 | { 223 | SelectAll(false); 224 | SelectInstalled(); 225 | linkLabel2.Cursor = Cursors.Hand; 226 | } 227 | 228 | private void applist_ItemCheck(object sender, ItemCheckEventArgs e) 229 | { 230 | int count = applist.CheckedItems.Count; 231 | 232 | if (e.NewValue == CheckState.Checked) 233 | { 234 | ++count; 235 | } 236 | if (e.NewValue == CheckState.Unchecked) 237 | { 238 | --count; 239 | } 240 | 241 | lblselectedapps.Text = count.ToString(); 242 | } 243 | 244 | private void button5_Click(object sender, EventArgs e) 245 | { 246 | 247 | } 248 | 249 | private void Main_FormClosing(object sender, FormClosingEventArgs e) 250 | { 251 | Options.SaveSettings(); 252 | } 253 | 254 | private void button6_Click(object sender, EventArgs e) 255 | { 256 | OptionsForm f = new OptionsForm(this); 257 | f.ShowDialog(this); 258 | } 259 | 260 | private void button4_Click(object sender, EventArgs e) 261 | { 262 | ManagerForm f = new ManagerForm(); 263 | f.ShowDialog(this); 264 | } 265 | 266 | private void button2_Click(object sender, EventArgs e) 267 | { 268 | if (applist.CheckedItems.Count > 0) 269 | { 270 | for (int i = 0; i < applist.Items.Count; i++) 271 | { 272 | if (applist.GetItemChecked(i)) 273 | { 274 | selectedAddons.Add(addons[i]); 275 | } 276 | } 277 | 278 | SelectorForm f = new SelectorForm(this); 279 | f.ShowDialog(this); 280 | 281 | if (CurrentRestorePath != "") 282 | { 283 | if (Directory.Exists(CurrentRestorePath)) 284 | { 285 | CloneHelper f2 = new CloneHelper(this, CloneType.Restore); 286 | f2.ShowDialog(this); 287 | } 288 | } 289 | } 290 | } 291 | 292 | private void button3_Click(object sender, EventArgs e) 293 | { 294 | DriversForm f = new DriversForm(); 295 | f.ShowDialog(); 296 | } 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /Cloning/MainForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL 124 | EgAACxIB0t1+/AAAGAFJREFUeF7tke0NLLmWHJ+T8kJerRfrgAyQQSvMRcxitC94+FEk67CaAcSv7kwm 125 | Wf+69POf/+v//tc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i67HDI4kNYX2RxFJju6/75XOkxTZHEluPHR5JbAjr 189 | iySWGtt93SufIj22vSSR9djhkcSGsL5IYqmx3de98inSY9tLElmPHR5JbAjriySWGtt93SufIj22vSSR 190 | 9djhkcSGsL6SRNJj26975VOkx7aXJLIeOzyS2BDWV5JIemz7da98ivTY9pJE1mOHRxIbwvoiiaXGdl/3 191 | yqdIj20vSWQ9dngksSGsL5JYamz3da98ivTY9pJE1mOHRxIbwvoiiaXGdl/3yqdIj20vSWQ9dngksSGs 192 | L5JYamz3db98jrTY5khi67HDI4kNYX2RxNJim6/vyCdJi22OJLYeOzyS2BDWV5NoSmxvJLFjsTuVJDKM 193 | dUYSS4ttjiS2Hjs8ktgw1hlJLCW2N5LYsdidShIZxjprEk2Hba1JdD12eCSxYawzklg6bGtNosdidypJ 194 | 5BHWG0ksHbY1ktgebEAksWGssybRVNjOSGJHY/cqSeQR1luTaBpsY02ie7ABkcQeYb2RxNJgG2sSPRq7 195 | V0kij7DemkTTYBtrEt2DDYgk9gjrrUk0BbavJtGjsXuVJPIY665J9HVsW02i+7ARkcQeYb0tEn8V21WT 196 | 6PHY3UoSeYx1t0j8NWxTi8T3YSMiiT3Gulsk/gq2p0Xix2N3K0nkMdbdIvHXsE0tEt+HjYgk9hjrbpWK 197 | rdiOFol/ArtfSSJTsP4WiW/HtrRIfC82JJLYFKy/VSq2YOe3SsUnsPuVJDIF62+Vim3Yhlap2IsNiSQ2 198 | BevvkZql2LmtUvEZ7I4liUzDzuiRmmXYmT1Ssx8bE0lsGnZGj9RMx87qlarPYHcsSWQqdk6P1EzHzuqR 199 | mnewQZHEpmLn9ErVFKy/V6o+hd2zJJGp2DkjUvcY6x6RunewQZHEpmLnjEplN9Y1KpWfw+5aksh07KxR 200 | qezGukal8j1sVCSx6dhZM6Resf/PkPrPYXctSWQJdt5TqS5imadS/S42LJLYdOysE+U6n8TuW5LIdOys 201 | E+U672PjIolNxc45Ua7zWezOJYlMx846Ua7zPjYuktg07IwT5Tqfx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zf1lK5RNNJ2HuAYj4mYlZ/ESLMAbA4idjiaSVEJcAkRJK8vCglSk6cd8BeEio 283 | CIu/Bh60MlUnIToAy7Dw6xCx+EWcG4D1pLL46xBZJ24vASy/W396ftK1joHYIFcnLjsAzVdsa84OLPr6 284 | aE0UaM/3x+LOALQ/mKhhBCz8Nmh2iTXMoIROXBlAia+lNv2/kschdahl6Oha6YahbOdScwAsX/eTelpB 285 | L8qaFDGAFi0Qi98eLS6rWPw3UTOAljdBWPy2aHljlVq5SbYBRH6GSqbRUiu5n/d61UmWAbD4yRioE1yS 286 | ngJYT6iI76Qi4UErnplsAB4SyuIvjwediPjXyqRXgT0k1XtCEfCgE5EYWhnVATChZCzUii12dgBeEkrK 287 | 40UrUYpfxPHXgOtESmoLWPw22XoJUHuJ4lbHJHlYe/OTXHPnewAIG1ggxEB2g5AnhBgsstEAtAZTayDR 288 | 4iHXoG1vhhYPOkUMoNQAosYVFeRio1bGcesmIPLAIe/cSqZRetkzamUcNzoASx9LWIrVI1bG30qcrVB5 289 | DNhioCIkxyO185ZzvAhdwAsDSD3ZloWIcMc4Ita0wsnibsK8CETa0roIOVlsJssAWicVJYZIpBQESo5Q 290 | 4kCiF7GdVJG0WLw7O9kMkm4R4CUAKYqHgvM8WSQZAGJSEWPyhpdCoFau6b0kNYXI514DFho+kzsA5KQi 291 | x0Zs43WycLU1WApeE0u2k7tMuBd4E5AUgd2YDSYZgIWkWoiREBTYARASGBoAIYGhAZCw8HKRBkBIaGgA 292 | JCx8DEgDICQ0NABCAuNuc1ALMRKCAjsAUgQasQ3CfwvAR0Hj8VTUns4lh8kdAPLAIcdGbON1oui9ntgY 293 | Ip97DWjI+CTdA0BMLGJM3vBimNTKNbwJSIriodi8GN8mehH7q+paX9WY1ANJtwhkdQAIg4kQQyQsTxYo 294 | cSDBSwBShdbFZ207s1q8MACLWycxqW2wppXW5oOMSgfQYoCZVJvUzhu3B99ONww3xyc3QaUHDT2+SKAX 295 | F7Wym1sdQO5Jl3R4JtQPF2eXA7XSnlsdgIheEWsNIlo85BqN3GjmBS0edDYagIjuTI5w0yhSUmuDkCeE 296 | GCxypwGIlGnndw1ui2OSPEq18tvy1uKYHtlqACL277ZHS2grrOtEJKZW+CIQUcF68ViPP5WdBmB5YCzH 297 | bhGr4201bg12XgKsYqXNi5xQBKzoRIRa4eagRB0rObASZ0kmdQBLUB2eCcWDWsEmyQCWoCSXycQGRSci 298 | 1Mo6WQYg0j65TKgdWmqFOtlMtgEsqZ1cJtQuNbVCnWxHzQBW4VtaZAwljYBaGUcRA1iFX2WRsVAr9fk/ 299 | sjr/Dl38qyIAAAAASUVORK5CYII= 300 | 301 | 302 | -------------------------------------------------------------------------------- /Cloning/ManagerForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cloning 2 | { 3 | partial class ManagerForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ManagerForm)); 32 | this.clonesdetected = new System.Windows.Forms.Label(); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.button1 = new System.Windows.Forms.Button(); 35 | this.deletebtn = new System.Windows.Forms.Button(); 36 | this.panel1 = new System.Windows.Forms.Panel(); 37 | this.label2 = new System.Windows.Forms.Label(); 38 | this.clonelist = new System.Windows.Forms.CheckedListBox(); 39 | this.totalsizetxt = new System.Windows.Forms.Label(); 40 | this.btnclose = new System.Windows.Forms.Button(); 41 | this.button2 = new System.Windows.Forms.Button(); 42 | this.panel1.SuspendLayout(); 43 | this.SuspendLayout(); 44 | // 45 | // clonesdetected 46 | // 47 | this.clonesdetected.AutoSize = true; 48 | this.clonesdetected.ForeColor = System.Drawing.Color.White; 49 | this.clonesdetected.Location = new System.Drawing.Point(14, 52); 50 | this.clonesdetected.Name = "clonesdetected"; 51 | this.clonesdetected.Size = new System.Drawing.Size(77, 20); 52 | this.clonesdetected.TabIndex = 3; 53 | this.clonesdetected.Text = "Backups : "; 54 | // 55 | // label1 56 | // 57 | this.label1.AutoSize = true; 58 | this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 59 | this.label1.ForeColor = System.Drawing.Color.DodgerBlue; 60 | this.label1.Location = new System.Drawing.Point(12, 9); 61 | this.label1.Name = "label1"; 62 | this.label1.Size = new System.Drawing.Size(200, 32); 63 | this.label1.TabIndex = 2; 64 | this.label1.Tag = "themeable"; 65 | this.label1.Text = "Backup Manager"; 66 | // 67 | // button1 68 | // 69 | this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 70 | this.button1.BackColor = System.Drawing.Color.DodgerBlue; 71 | this.button1.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 72 | this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 73 | this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 74 | this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 75 | this.button1.ForeColor = System.Drawing.Color.White; 76 | this.button1.Location = new System.Drawing.Point(111, 447); 77 | this.button1.Name = "button1"; 78 | this.button1.Size = new System.Drawing.Size(85, 39); 79 | this.button1.TabIndex = 11; 80 | this.button1.Text = "Delete"; 81 | this.button1.UseVisualStyleBackColor = false; 82 | this.button1.Click += new System.EventHandler(this.button1_Click); 83 | // 84 | // deletebtn 85 | // 86 | this.deletebtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 87 | this.deletebtn.BackColor = System.Drawing.Color.DodgerBlue; 88 | this.deletebtn.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 89 | this.deletebtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 90 | this.deletebtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 91 | this.deletebtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 92 | this.deletebtn.ForeColor = System.Drawing.Color.White; 93 | this.deletebtn.Location = new System.Drawing.Point(12, 447); 94 | this.deletebtn.Name = "deletebtn"; 95 | this.deletebtn.Size = new System.Drawing.Size(93, 39); 96 | this.deletebtn.TabIndex = 10; 97 | this.deletebtn.Text = "Delete all"; 98 | this.deletebtn.UseVisualStyleBackColor = false; 99 | this.deletebtn.Click += new System.EventHandler(this.deletebtn_Click); 100 | // 101 | // panel1 102 | // 103 | this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 104 | | System.Windows.Forms.AnchorStyles.Left) 105 | | System.Windows.Forms.AnchorStyles.Right))); 106 | this.panel1.Controls.Add(this.label2); 107 | this.panel1.Controls.Add(this.clonelist); 108 | this.panel1.Location = new System.Drawing.Point(18, 114); 109 | this.panel1.Name = "panel1"; 110 | this.panel1.Size = new System.Drawing.Size(360, 318); 111 | this.panel1.TabIndex = 12; 112 | // 113 | // label2 114 | // 115 | this.label2.Dock = System.Windows.Forms.DockStyle.Fill; 116 | this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); 117 | this.label2.ForeColor = System.Drawing.Color.DodgerBlue; 118 | this.label2.Location = new System.Drawing.Point(0, 0); 119 | this.label2.Name = "label2"; 120 | this.label2.Size = new System.Drawing.Size(360, 318); 121 | this.label2.TabIndex = 6; 122 | this.label2.Tag = "themeable"; 123 | this.label2.Text = "No backups"; 124 | this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 125 | this.label2.Visible = false; 126 | // 127 | // clonelist 128 | // 129 | this.clonelist.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 130 | this.clonelist.BorderStyle = System.Windows.Forms.BorderStyle.None; 131 | this.clonelist.CheckOnClick = true; 132 | this.clonelist.Dock = System.Windows.Forms.DockStyle.Fill; 133 | this.clonelist.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 134 | this.clonelist.ForeColor = System.Drawing.Color.White; 135 | this.clonelist.FormattingEnabled = true; 136 | this.clonelist.Location = new System.Drawing.Point(0, 0); 137 | this.clonelist.Name = "clonelist"; 138 | this.clonelist.Size = new System.Drawing.Size(360, 318); 139 | this.clonelist.TabIndex = 5; 140 | // 141 | // totalsizetxt 142 | // 143 | this.totalsizetxt.AutoSize = true; 144 | this.totalsizetxt.ForeColor = System.Drawing.Color.White; 145 | this.totalsizetxt.Location = new System.Drawing.Point(14, 81); 146 | this.totalsizetxt.Name = "totalsizetxt"; 147 | this.totalsizetxt.Size = new System.Drawing.Size(75, 20); 148 | this.totalsizetxt.TabIndex = 13; 149 | this.totalsizetxt.Text = "Total size:"; 150 | // 151 | // btnclose 152 | // 153 | this.btnclose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 154 | this.btnclose.BackColor = System.Drawing.Color.DodgerBlue; 155 | this.btnclose.DialogResult = System.Windows.Forms.DialogResult.Cancel; 156 | this.btnclose.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 157 | this.btnclose.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 158 | this.btnclose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 159 | this.btnclose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 160 | this.btnclose.ForeColor = System.Drawing.Color.White; 161 | this.btnclose.Location = new System.Drawing.Point(293, 447); 162 | this.btnclose.Name = "btnclose"; 163 | this.btnclose.Size = new System.Drawing.Size(85, 39); 164 | this.btnclose.TabIndex = 14; 165 | this.btnclose.Text = "OK"; 166 | this.btnclose.UseVisualStyleBackColor = false; 167 | this.btnclose.Click += new System.EventHandler(this.button2_Click); 168 | // 169 | // button2 170 | // 171 | this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 172 | this.button2.BackColor = System.Drawing.Color.DodgerBlue; 173 | this.button2.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 174 | this.button2.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 175 | this.button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 176 | this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 177 | this.button2.ForeColor = System.Drawing.Color.White; 178 | this.button2.Location = new System.Drawing.Point(202, 447); 179 | this.button2.Name = "button2"; 180 | this.button2.Size = new System.Drawing.Size(85, 39); 181 | this.button2.TabIndex = 15; 182 | this.button2.Text = "Open"; 183 | this.button2.UseVisualStyleBackColor = false; 184 | this.button2.Click += new System.EventHandler(this.button2_Click_1); 185 | // 186 | // Manager 187 | // 188 | this.AcceptButton = this.btnclose; 189 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 190 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 191 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 192 | this.CancelButton = this.btnclose; 193 | this.ClientSize = new System.Drawing.Size(390, 498); 194 | this.Controls.Add(this.button2); 195 | this.Controls.Add(this.btnclose); 196 | this.Controls.Add(this.totalsizetxt); 197 | this.Controls.Add(this.panel1); 198 | this.Controls.Add(this.button1); 199 | this.Controls.Add(this.deletebtn); 200 | this.Controls.Add(this.clonesdetected); 201 | this.Controls.Add(this.label1); 202 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 203 | this.ForeColor = System.Drawing.Color.White; 204 | this.MinimizeBox = false; 205 | this.Name = "Manager"; 206 | this.ShowIcon = false; 207 | this.ShowInTaskbar = false; 208 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 209 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 210 | this.Load += new System.EventHandler(this.Manager_Load); 211 | this.panel1.ResumeLayout(false); 212 | this.ResumeLayout(false); 213 | this.PerformLayout(); 214 | 215 | } 216 | 217 | #endregion 218 | 219 | private System.Windows.Forms.Label clonesdetected; 220 | private System.Windows.Forms.Label label1; 221 | private System.Windows.Forms.Button button1; 222 | private System.Windows.Forms.Button deletebtn; 223 | private System.Windows.Forms.Panel panel1; 224 | private System.Windows.Forms.CheckedListBox clonelist; 225 | private System.Windows.Forms.Label totalsizetxt; 226 | private System.Windows.Forms.Button btnclose; 227 | private System.Windows.Forms.Label label2; 228 | private System.Windows.Forms.Button button2; 229 | } 230 | } -------------------------------------------------------------------------------- /Cloning/ManagerForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.Drawing; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace Cloning 14 | { 15 | public partial class ManagerForm : Form 16 | { 17 | DirectoryInfo CloneToDelete; 18 | List CheckedClones = new List(); 19 | 20 | string deleteallclonesmsg = "Are you sure you want to delete all backups?"; 21 | 22 | internal void DeleteAll() 23 | { 24 | try 25 | { 26 | foreach (string s in clonelist.Items) 27 | { 28 | if (Directory.Exists(Options.DataFolder + s)) 29 | { 30 | Directory.Delete(Options.DataFolder + s, true); 31 | } 32 | } 33 | } 34 | catch { } 35 | } 36 | 37 | private void DeleteSelected() 38 | { 39 | foreach (string item in CheckedClones) 40 | { 41 | CloneToDelete = new DirectoryInfo(Options.DataFolder + item + "\\"); 42 | CloneToDelete.Delete(true); 43 | } 44 | } 45 | 46 | private void RefreshCheckedClones() 47 | { 48 | CheckedClones.Clear(); 49 | 50 | foreach (var item in clonelist.CheckedItems) 51 | { 52 | CheckedClones.Add(item.ToString()); 53 | } 54 | } 55 | 56 | internal void LoadCloneList() 57 | { 58 | clonelist.Items.Clear(); 59 | 60 | int counter = 0; 61 | ByteSize totalsize = ByteSize.FromBytes(0); 62 | 63 | if (Directory.Exists(Options.DataFolder)) 64 | { 65 | string[] clones = Directory.GetDirectories(Options.DataFolder); 66 | 67 | foreach (string clone in clones) 68 | { 69 | counter++; 70 | clonelist.Items.Add(Path.GetFileName(clone)); 71 | 72 | DirectoryInfo di = new DirectoryInfo(clone); 73 | totalsize += ByteSize.FromBytes(Convert.ToDouble(di.EnumerateFiles("*", SearchOption.AllDirectories).Sum(fi => fi.Length))); 74 | } 75 | } 76 | 77 | clonesdetected.Text = "Backups: " + counter.ToString(); 78 | 79 | if (counter > 0) 80 | { 81 | totalsizetxt.Text = "Total size: " + totalsize; 82 | } 83 | else 84 | { 85 | totalsizetxt.Text = "Total size: -"; 86 | } 87 | 88 | if (clonelist.Items.Count == 0) 89 | { 90 | clonelist.Visible = false; 91 | label2.Visible = true; 92 | } 93 | else 94 | { 95 | clonelist.Visible = true; 96 | label2.Visible = false; 97 | } 98 | } 99 | 100 | public ManagerForm() 101 | { 102 | InitializeComponent(); 103 | Options.ApplyTheme(this); 104 | } 105 | 106 | private void Manager_Load(object sender, EventArgs e) 107 | { 108 | LoadCloneList(); 109 | } 110 | 111 | private void button1_Click(object sender, EventArgs e) 112 | { 113 | RefreshCheckedClones(); 114 | DeleteSelected(); 115 | 116 | LoadCloneList(); 117 | } 118 | 119 | private void deletebtn_Click(object sender, EventArgs e) 120 | { 121 | if (clonelist.Items.Count > 0) 122 | { 123 | MessagerForm f = new MessagerForm(this, MessagerType.Question, deleteallclonesmsg); 124 | f.ShowDialog(this); 125 | } 126 | } 127 | 128 | private void button2_Click(object sender, EventArgs e) 129 | { 130 | this.Close(); 131 | } 132 | 133 | private void button2_Click_1(object sender, EventArgs e) 134 | { 135 | Process.Start(Options.DataFolder); 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /Cloning/MessagerForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cloning 2 | { 3 | partial class MessagerForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessagerForm)); 32 | this.nobtn = new System.Windows.Forms.Button(); 33 | this.yesbtn = new System.Windows.Forms.Button(); 34 | this.msg = new System.Windows.Forms.Label(); 35 | this.SuspendLayout(); 36 | // 37 | // nobtn 38 | // 39 | this.nobtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 40 | this.nobtn.BackColor = System.Drawing.Color.DodgerBlue; 41 | this.nobtn.DialogResult = System.Windows.Forms.DialogResult.No; 42 | this.nobtn.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 43 | this.nobtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 44 | this.nobtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 45 | this.nobtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 46 | this.nobtn.ForeColor = System.Drawing.Color.White; 47 | this.nobtn.Location = new System.Drawing.Point(306, 135); 48 | this.nobtn.Name = "nobtn"; 49 | this.nobtn.Size = new System.Drawing.Size(120, 39); 50 | this.nobtn.TabIndex = 35; 51 | this.nobtn.Tag = "themeable"; 52 | this.nobtn.Text = "No"; 53 | this.nobtn.UseVisualStyleBackColor = false; 54 | this.nobtn.Click += new System.EventHandler(this.nobtn_Click); 55 | // 56 | // yesbtn 57 | // 58 | this.yesbtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 59 | this.yesbtn.BackColor = System.Drawing.Color.DodgerBlue; 60 | this.yesbtn.DialogResult = System.Windows.Forms.DialogResult.Yes; 61 | this.yesbtn.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 62 | this.yesbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 63 | this.yesbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 64 | this.yesbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 65 | this.yesbtn.ForeColor = System.Drawing.Color.White; 66 | this.yesbtn.Location = new System.Drawing.Point(432, 135); 67 | this.yesbtn.Name = "yesbtn"; 68 | this.yesbtn.Size = new System.Drawing.Size(120, 39); 69 | this.yesbtn.TabIndex = 34; 70 | this.yesbtn.Tag = "themeable"; 71 | this.yesbtn.Text = "Yes"; 72 | this.yesbtn.UseVisualStyleBackColor = false; 73 | this.yesbtn.Click += new System.EventHandler(this.yesbtn_Click); 74 | // 75 | // msg 76 | // 77 | this.msg.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(161))); 78 | this.msg.Location = new System.Drawing.Point(12, 11); 79 | this.msg.Name = "msg"; 80 | this.msg.Size = new System.Drawing.Size(540, 86); 81 | this.msg.TabIndex = 33; 82 | this.msg.Text = "Restart to apply changes?"; 83 | // 84 | // Messager 85 | // 86 | this.AcceptButton = this.yesbtn; 87 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 88 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 89 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 90 | this.CancelButton = this.nobtn; 91 | this.ClientSize = new System.Drawing.Size(564, 184); 92 | this.Controls.Add(this.nobtn); 93 | this.Controls.Add(this.yesbtn); 94 | this.Controls.Add(this.msg); 95 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 96 | this.ForeColor = System.Drawing.Color.White; 97 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 98 | this.MaximizeBox = false; 99 | this.MinimizeBox = false; 100 | this.Name = "Messager"; 101 | this.ShowIcon = false; 102 | this.ShowInTaskbar = false; 103 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 104 | this.Load += new System.EventHandler(this.Messager_Load); 105 | this.ResumeLayout(false); 106 | 107 | } 108 | 109 | #endregion 110 | 111 | private System.Windows.Forms.Button nobtn; 112 | private System.Windows.Forms.Button yesbtn; 113 | private System.Windows.Forms.Label msg; 114 | } 115 | } -------------------------------------------------------------------------------- /Cloning/MessagerForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.IO; 11 | using System.Threading; 12 | 13 | namespace Cloning 14 | { 15 | public partial class MessagerForm : Form 16 | { 17 | ManagerForm _manager; 18 | MessagerType mode; 19 | 20 | private void Confirm() 21 | { 22 | if (mode == MessagerType.Info) 23 | { 24 | this.Close(); 25 | } 26 | if (mode == MessagerType.Question) 27 | { 28 | _manager.DeleteAll(); 29 | 30 | _manager.LoadCloneList(); 31 | } 32 | } 33 | 34 | public MessagerForm(ManagerForm manager, MessagerType m, string s) 35 | { 36 | InitializeComponent(); 37 | Options.ApplyTheme(this); 38 | 39 | _manager = manager; 40 | mode = m; 41 | msg.Text = s; 42 | 43 | if (mode == MessagerType.Info) 44 | { 45 | nobtn.Visible = false; 46 | yesbtn.Text = "OK"; 47 | 48 | this.AcceptButton = nobtn; 49 | this.AcceptButton = yesbtn; 50 | this.CancelButton = nobtn; 51 | this.CancelButton = yesbtn; 52 | } 53 | } 54 | 55 | private void Messager_Load(object sender, EventArgs e) 56 | { 57 | CheckForIllegalCrossThreadCalls = false; 58 | this.BringToFront(); 59 | } 60 | 61 | private void nobtn_Click(object sender, EventArgs e) 62 | { 63 | this.Close(); 64 | } 65 | 66 | private void yesbtn_Click(object sender, EventArgs e) 67 | { 68 | Confirm(); 69 | this.Close(); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Cloning/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellzerg/cloning/92a2243b33eece259b993bc13b9a5546a9a8d2d7/Cloning/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Cloning/Options.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.Windows.Forms; 8 | using Newtonsoft.Json; 9 | using System.Drawing; 10 | 11 | namespace Cloning 12 | { 13 | public class SettingsJson 14 | { 15 | public Theme Color { get; set; } 16 | } 17 | 18 | public static class Options 19 | { 20 | internal readonly static string DataFolder = Application.StartupPath + "\\Data\\"; 21 | internal static Color BackgroundColor = Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 22 | internal static Color ForegroundColor = Color.DodgerBlue; 23 | 24 | readonly static string flag = "themeable"; 25 | readonly static string SettingsFile = DataFolder + "Cloning.json"; 26 | 27 | internal static SettingsJson CurrentOptions = new SettingsJson(); 28 | 29 | // use this to determine if changes have been made 30 | private static SettingsJson Flag = new SettingsJson(); 31 | 32 | internal static IEnumerable GetSelfAndChildrenRecursive(Control parent) 33 | { 34 | List controls = new List(); 35 | 36 | foreach (Control child in parent.Controls) 37 | { 38 | controls.AddRange(GetSelfAndChildrenRecursive(child)); 39 | } 40 | 41 | controls.Add(parent); 42 | return controls; 43 | } 44 | 45 | internal static void ApplyTheme(Form f) 46 | { 47 | switch (CurrentOptions.Color) 48 | { 49 | case Theme.Caramel: 50 | SetTheme(f, Color.DarkOrange, Color.Chocolate); 51 | break; 52 | case Theme.Lime: 53 | SetTheme(f, Color.LimeGreen, Color.ForestGreen); 54 | break; 55 | case Theme.Magma: 56 | SetTheme(f, Color.Tomato, Color.Red); 57 | break; 58 | case Theme.Minimal: 59 | SetTheme(f, Color.Gray, Color.DimGray); 60 | break; 61 | case Theme.Ocean: 62 | SetTheme(f, Color.DodgerBlue, Color.RoyalBlue); 63 | break; 64 | case Theme.Zerg: 65 | SetTheme(f, Color.MediumOrchid, Color.DarkOrchid); 66 | break; 67 | } 68 | } 69 | 70 | private static void SetTheme(Form f, Color c1, Color c2) 71 | { 72 | ForegroundColor = c1; 73 | GetSelfAndChildrenRecursive(f).OfType