From 3188641ca67252f3fdda5876e12fab0e967b66b8 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Wed, 29 Dec 2021 22:09:29 +0100 Subject: [PATCH] - Fix formatting --- MainForm.Designer.cs | 2 +- MainForm.cs | 50 +++++++++++------- .../DesignTimeResolveAssemblyReferences.cache | Bin 1435 -> 805 bytes ...gnTimeResolveAssemblyReferencesInput.cache | Bin 7531 -> 7385 bytes 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 31717f2..1c5613e 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -218,7 +218,7 @@ this.mainPanel.Controls.Add(this.addDestinationFolderButton); this.mainPanel.Location = new System.Drawing.Point(0, 0); this.mainPanel.Name = "mainPanel"; - this.mainPanel.Size = new System.Drawing.Size(774, 440); + this.mainPanel.Size = new System.Drawing.Size(759, 440); this.mainPanel.TabIndex = 8; // // optionsPanel diff --git a/MainForm.cs b/MainForm.cs index 914abb2..8a4830d 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1,4 +1,5 @@ using Microsoft.Win32; + using System; using System.Collections.Generic; using System.Drawing; @@ -43,9 +44,9 @@ namespace AutoBackup if ((string)Registry.GetValue(registrykey, "OnOff", "Off") == "On") { OnOffToggleButton_Click(null, null); - this.ShowInTaskbar = false; - this.Visible = false; - this.WindowState = FormWindowState.Minimized; + ShowInTaskbar = false; + Visible = false; + WindowState = FormWindowState.Minimized; } } catch { } @@ -53,9 +54,9 @@ namespace AutoBackup MainForm_SizeChanged(null, null); MainTimer.Start(); - notifyIcon.Icon = this.Icon; + notifyIcon.Icon = Icon; notifyIcon.Visible = true; - notifyIcon.Text = this.Text; + notifyIcon.Text = Text; toolTip.SetToolTip(maxBackupsNumericUpDown, "0 = no limit"); @@ -102,7 +103,9 @@ namespace AutoBackup private void LoadFolders() { if (!File.Exists(localApplicationDataPath + "\\data.save")) + { return; + } int index = 0; string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save"); @@ -195,7 +198,7 @@ namespace AutoBackup private void SelectFolderButton_Click(object sender, EventArgs e) { - using (var fbd = new FolderBrowserDialog()) + using (FolderBrowserDialog fbd = new FolderBrowserDialog()) { DialogResult result = fbd.ShowDialog(); @@ -296,7 +299,10 @@ namespace AutoBackup private void BackupTimeNumericUpDown_ValueChanged(object sender, EventArgs e) { - if (blockWrite) return; + if (blockWrite) + { + return; + } //Registry.SetValue(registrykey, "backupTime", backupTimeNumericUpDown.Value); string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save"); string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">")); @@ -311,7 +317,10 @@ namespace AutoBackup private void TimeUnitComboBox_SelectedIndexChanged(object sender, EventArgs e) { - if (blockWrite) return; + if (blockWrite) + { + return; + } //Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex); string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save"); string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">")); @@ -326,7 +335,10 @@ namespace AutoBackup private void MaxBackupsNumericUpDown_ValueChanged(object sender, EventArgs e) { - if (blockWrite) return; + if (blockWrite) + { + return; + } //Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex); string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save"); string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">")); @@ -341,24 +353,24 @@ namespace AutoBackup private void NotifyIcon_MouseClick(object sender, MouseEventArgs e) { - this.WindowState = FormWindowState.Normal; - this.Visible = true; - this.ShowInTaskbar = true; + WindowState = FormWindowState.Normal; + Visible = true; + ShowInTaskbar = true; backup.windowVisible = true; } private void MainForm_SizeChanged(object sender, EventArgs e) { - addFolderPopup.Location = new Point(this.Width / 2 - addFolderPopup.Width / 2, this.Height / 2 - addFolderPopup.Height / 2); + addFolderPopup.Location = new Point(Width / 2 - addFolderPopup.Width / 2, Height / 2 - addFolderPopup.Height / 2); int space = 20; - sourceFoldersListBox.Height = this.Height - 243; - sourceFoldersListBox.Width = this.Width / 2 - 13 - space; + sourceFoldersListBox.Height = Height - 243; + sourceFoldersListBox.Width = Width / 2 - 13 - space; - destinationFoldersListBox.Height = this.Height - 243; - destinationFoldersListBox.Location = new Point(this.Width / 2 - 15 + space, destinationFoldersListBox.Location.Y); - destinationFoldersListBox.Width = this.Width / 2 - 13 - space; + destinationFoldersListBox.Height = Height - 243; + destinationFoldersListBox.Location = new Point(Width / 2 - 15 + space, destinationFoldersListBox.Location.Y); + destinationFoldersListBox.Width = Width / 2 - 13 - space; addSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X, sourceFoldersListBox.Height + 25); removeSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width - removeSourceFolderButton.Width, sourceFoldersListBox.Height + 25); @@ -369,7 +381,7 @@ namespace AutoBackup sourceDirectoriesLabel.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width / 2 - sourceDirectoriesLabel.Width / 2, sourceDirectoriesLabel.Location.Y); destinationDirectoriesLabel.Location = new Point(destinationFoldersListBox.Location.X + destinationFoldersListBox.Width / 2 - destinationDirectoriesLabel.Width / 2, destinationDirectoriesLabel.Location.Y); - mainPanel.Height = this.Height; + mainPanel.Height = Height; if (WindowState == FormWindowState.Minimized && ShowInTaskbar == true) { diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 53f6a01cea3b8708ed13419610ddcb340f906e5d..9ed41e9b10b853cde4fdbe201db28dbe44fda28a 100644 GIT binary patch literal 805 zcmcJLv5LY#6h&tm5x*jhur@=~#oe{jXgU{BA-TIVcTj?ZT0yiR0#j%Nk{eXck}VsV zc7JHCJ4^AqKK!rCr}z>RX-HY8u@EP%Iqx{^{>+Atzy2FJ=uWYi#?$c+<0c4yf1?JB y$gn=ymPBfuA-~Hpq>Hyi8IryN!m9QssDetkyv4fmTZBomPzs2!K#k4KEAaxh)dHFT literal 1435 zcmcIk-EPw`7(7AlH@M&;+<{iClu|a3Dl|GOB>o1i#!bZJCSQtGC!XwNrMw1D zz+>M$?10P=TP)RN0j6Th|i0GK< znWh7&pzR%l(p;wfPLFn|PyMzx$VHYb=%6<^qaU<<|Kt<3b1sGh;#1=S+Xh*hB!ju2&2=2>+#4 z4WaQ;vS`S{OscJAJxybGAd^$3K-KWOBmNm2^H5ihnaDvCQX#I}tnDm)yipNPnON=l z`F8(F4Q)6EF5|>SKsg5={bL_i**xLX)Py@=8i-}Ja3k)kZW)LNkAov6r-~)s(4?Wg zJD>I+-VNSC3<}Z^yaTNvF^Pi?R-pz%!-u(4vw*&SHvY3ZdqDT-{a{(dA!s8_BO$8j zeKT4IVF+6D2^TzD6k2to#Wqq`qC=?!pA<3;BXhD5nPq&KThoY4Hz{(c*qo=+qM~gh zmTXe&Jx?P!*K{aVqEWI{G@_BMUqHBsa0#J>Q1tl~Gjs9n?yCL%`fr?vRh;5o?BHUC ztzAiEIrLE`UMmx^fOW*{Wg-^2j<{1MVi4P)q?}9}lO_>;C6l(J-%6Ji@u#}fyCXg6~Yk9?F0*F({z4<%uRBoc|-+Vw)k{JM2c4ylF