Browse Source

format code

liuyuqi-dellpc 4 years ago
parent
commit
14bcf0d3ca

+ 19 - 19
quick-color-picker/App.config

@@ -1,21 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
 <configuration>
-    <configSections>
-        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-            <section name="quick_color_picker.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
-        </sectionGroup>
-    </configSections>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
-    </startup>
-    <userSettings>
-        <quick_color_picker.Properties.Settings>
-            <setting name="AlwaysOnTop" serializeAs="String">
-                <value>True</value>
-            </setting>
-            <setting name="AnotherFormat" serializeAs="String">
-                <value>False</value>
-            </setting>
-        </quick_color_picker.Properties.Settings>
-    </userSettings>
-</configuration>
+  <configSections>
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="quick_color_picker.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+    </sectionGroup>
+  </configSections>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+  </startup>
+  <userSettings>
+    <quick_color_picker.Properties.Settings>
+      <setting name="AlwaysOnTop" serializeAs="String">
+        <value>True</value>
+      </setting>
+      <setting name="AnotherFormat" serializeAs="String">
+        <value>False</value>
+      </setting>
+    </quick_color_picker.Properties.Settings>
+  </userSettings>
+</configuration>

+ 54 - 54
quick-color-picker/ColorManager.cs

@@ -3,69 +3,69 @@ using System.Drawing;
 
 
 namespace quick_color_picker
 namespace quick_color_picker
 {
 {
-	public static class ColorManager
-	{
-		public static int[] ColorToHSV(Color color)
-		{
-			int max = Math.Max(color.R, Math.Max(color.G, color.B));
-			int min = Math.Min(color.R, Math.Min(color.G, color.B));
+    public static class ColorManager
+    {
+        public static int[] ColorToHSV(Color color)
+        {
+            int max = Math.Max(color.R, Math.Max(color.G, color.B));
+            int min = Math.Min(color.R, Math.Min(color.G, color.B));
 
 
-			double hue = color.GetHue();
-			double saturation = (max == 0) ? 0 : 1d - (1d * min / max);
-			double value = max / 255d;
+            double hue = color.GetHue();
+            double saturation = (max == 0) ? 0 : 1d - (1d * min / max);
+            double value = max / 255d;
 
 
-			int h = Convert.ToInt32(hue);
-			int s = Convert.ToInt32(saturation * 100);
-			int v = Convert.ToInt32(value * 100);
+            int h = Convert.ToInt32(hue);
+            int s = Convert.ToInt32(saturation * 100);
+            int v = Convert.ToInt32(value * 100);
 
 
-			return new int[] { h, s, v };
-		}
+            return new int[] { h, s, v };
+        }
 
 
-		public static int[] ColorToHSL(Color color)
-		{
-			float hue = color.GetHue();
-			float saturation = color.GetSaturation();
-			float lightness = color.GetBrightness();
+        public static int[] ColorToHSL(Color color)
+        {
+            float hue = color.GetHue();
+            float saturation = color.GetSaturation();
+            float lightness = color.GetBrightness();
 
 
-			int intHue = Convert.ToInt32(hue);
-			int intSaturation = Convert.ToInt32(saturation * 100);
-			int intLightness = Convert.ToInt32(lightness * 100);
+            int intHue = Convert.ToInt32(hue);
+            int intSaturation = Convert.ToInt32(saturation * 100);
+            int intLightness = Convert.ToInt32(lightness * 100);
 
 
-			return new int[] { intHue, intSaturation, intLightness };
-		}
+            return new int[] { intHue, intSaturation, intLightness };
+        }
 
 
-		public static int[] ColorToCMYK(Color color)
-		{
-			double c, m, y, k;
-			double r = color.R, g = color.G, b = color.B;
-			double r1 = r / 255, g1 = g / 255, b1 = b / 255;
+        public static int[] ColorToCMYK(Color color)
+        {
+            double c, m, y, k;
+            double r = color.R, g = color.G, b = color.B;
+            double r1 = r / 255, g1 = g / 255, b1 = b / 255;
 
 
-			k = 1 - Math.Max(Math.Max(r1, g1), b1);
+            k = 1 - Math.Max(Math.Max(r1, g1), b1);
 
 
-			if (k == 1)
-			{
-				return new int[] { 0, 0, 0, 1 };
-			}
-			else
-			{
-				c = (1 - r1 - k) / (1 - k);
-				m = (1 - g1 - k) / (1 - k);
-				y = (1 - b1 - k) / (1 - k);
+            if (k == 1)
+            {
+                return new int[] { 0, 0, 0, 1 };
+            }
+            else
+            {
+                c = (1 - r1 - k) / (1 - k);
+                m = (1 - g1 - k) / (1 - k);
+                y = (1 - b1 - k) / (1 - k);
 
 
-				int intC = Convert.ToInt32(c * 100);
-				int intM = Convert.ToInt32(m * 100);
-				int intY = Convert.ToInt32(y * 100);
-				int intK = Convert.ToInt32(k * 100);
+                int intC = Convert.ToInt32(c * 100);
+                int intM = Convert.ToInt32(m * 100);
+                int intY = Convert.ToInt32(y * 100);
+                int intK = Convert.ToInt32(k * 100);
 
 
-				return new int[] { intC, intM, intY, intK };
-			}
-		}
+                return new int[] { intC, intM, intY, intK };
+            }
+        }
 
 
-		public static Color TextToColor(string text)
-		{
-			string[] strArr = text.Split(',');
-			int[] arr = Array.ConvertAll(strArr, s => int.Parse(s));
-			return Color.FromArgb(arr[0], arr[1], arr[2]);
-		}
-	}
-}
+        public static Color TextToColor(string text)
+        {
+            string[] strArr = text.Split(',');
+            int[] arr = Array.ConvertAll(strArr, s => int.Parse(s));
+            return Color.FromArgb(arr[0], arr[1], arr[2]);
+        }
+    }
+}

+ 3 - 3
quick-color-picker/Properties/AssemblyInfo.cs

@@ -1,5 +1,5 @@
-using System.Resources;
-using System.Reflection;
+using System.Reflection;
+using System.Resources;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
 
 
 // General Information about an assembly is controlled through the following
 // General Information about an assembly is controlled through the following
@@ -34,4 +34,4 @@ using System.Runtime.InteropServices;
 // [assembly: AssemblyVersion("1.0.*")]
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.3.0")]
 [assembly: AssemblyVersion("1.3.0")]
 [assembly: AssemblyFileVersion("1.3.0")]
 [assembly: AssemblyFileVersion("1.3.0")]
-[assembly: NeutralResourcesLanguage("en")]
+[assembly: NeutralResourcesLanguage("en")]

+ 146 - 146
quick-color-picker/ThemeManager.cs

@@ -7,149 +7,149 @@ using System.Windows.Forms;
 
 
 namespace quick_color_picker
 namespace quick_color_picker
 {
 {
-	class ThemeManager
-	{
-		public static Color MainColorDark = Color.Black;
-		public static Color BackColorDark = Color.FromArgb(32, 32, 32);
-		public static Color SecondColorDark = Color.FromArgb(56, 56, 56);
-		public static Color AccentColorDark = Color.FromArgb(73, 169, 207);
-
-		private enum WindowCompositionAttribute
-		{
-			WCA_UNDEFINED = 0,
-			WCA_NCRENDERING_ENABLED = 1,
-			WCA_NCRENDERING_POLICY = 2,
-			WCA_TRANSITIONS_FORCEDISABLED = 3,
-			WCA_ALLOW_NCPAINT = 4,
-			WCA_CAPTION_BUTTON_BOUNDS = 5,
-			WCA_NONCLIENT_RTL_LAYOUT = 6,
-			WCA_FORCE_ICONIC_REPRESENTATION = 7,
-			WCA_EXTENDED_FRAME_BOUNDS = 8,
-			WCA_HAS_ICONIC_BITMAP = 9,
-			WCA_THEME_ATTRIBUTES = 10,
-			WCA_NCRENDERING_EXILED = 11,
-			WCA_NCADORNMENTINFO = 12,
-			WCA_EXCLUDED_FROM_LIVEPREVIEW = 13,
-			WCA_VIDEO_OVERLAY_ACTIVE = 14,
-			WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15,
-			WCA_DISALLOW_PEEK = 16,
-			WCA_CLOAK = 17,
-			WCA_CLOAKED = 18,
-			WCA_ACCENT_POLICY = 19,
-			WCA_FREEZE_REPRESENTATION = 20,
-			WCA_EVER_UNCLOAKED = 21,
-			WCA_VISUAL_OWNER = 22,
-			WCA_HOLOGRAPHIC = 23,
-			WCA_EXCLUDED_FROM_DDA = 24,
-			WCA_PASSIVEUPDATEMODE = 25,
-			WCA_USEDARKMODECOLORS = 26,
-			WCA_LAST = 27
-		};
-
-		private struct WindowCompositionAttribData
-		{
-			public WindowCompositionAttribute Attribute;
-			public IntPtr Data;
-			public int SizeOfData;
-		}
-
-		[DllImport("uxtheme.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
-		private static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
-
-		[DllImport("uxtheme.dll", EntryPoint = "#133", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
-		private static extern bool AllowDarkModeForWindow(IntPtr hWnd, bool allow);
-
-		[DllImport("uxtheme.dll", EntryPoint = "#135", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
-		private static extern bool AllowDarkModeForApp(bool allow);
-
-		[DllImport("user32.dll")]
-		private static extern bool SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttribData data);
-
-		private static void enableDarkTitlebar(IntPtr handle, bool dark)
-		{
-			AllowDarkModeForWindow(handle, dark);
-
-			var sizeOfData = Marshal.SizeOf(dark);
-			var dataPtr = Marshal.AllocHGlobal(sizeOfData);
-
-			var data = new WindowCompositionAttribData
-			{
-				Attribute = WindowCompositionAttribute.WCA_USEDARKMODECOLORS,
-				Data = dataPtr,
-				SizeOfData = sizeOfData
-			};
-			SetWindowCompositionAttribute(handle, ref data);
-
-			Marshal.FreeHGlobal(dataPtr);
-		}
-
-		public static void allowDarkModeForApp(bool dark)
-		{
-			AllowDarkModeForApp(dark);
-		}
-
-		public static void formHandleCreated(object sender, EventArgs e)
-		{
-			Form f = sender as Form;
-			enableDarkTitlebar(f.Handle, true);
-		}
-
-		public static void setDarkModeToControl(IntPtr handle)
-		{
-			SetWindowTheme(handle, "DarkMode_Explorer", null);
-		}
-
-		public static bool isDarkTheme()
-		{
-			if (isWindows10())
-			{
-				try
-				{
-					string root = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
-					string str = Registry.GetValue(root, "AppsUseLightTheme", null).ToString();
-					return (str == "0");
-				}
-				catch
-				{
-					return false;
-				}
-			}
-			else
-			{
-				return false;
-			}
-		}
-
-		public static bool isWindows10()
-		{
-			try
-			{
-				var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
-				string productName = (string)reg.GetValue("ProductName");
-				return productName.StartsWith("Windows 10");
-			}
-			catch
-			{
-				return false;
-			}
-		}
-
-		public static void PaintDarkGroupBox(object sender, PaintEventArgs p)
-		{
-			GroupBox box = (GroupBox)sender;
-
-			SolidBrush brush = new SolidBrush(ThemeManager.SecondColorDark);
-			Pen pen = new Pen(brush, 1);
-
-			p.Graphics.Clear(ThemeManager.BackColorDark);
-
-			p.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
-			p.Graphics.DrawString(box.Text, box.Font, Brushes.White, -1, -3);
-
-			p.Graphics.DrawLine(pen, 0, 16, 0, box.Height - 2);
-			p.Graphics.DrawLine(pen, 0, 16, box.Width - 1, 16);
-			p.Graphics.DrawLine(pen, box.Width - 1, 16, box.Width - 1, box.Height - 2);
-			p.Graphics.DrawLine(pen, 0, box.Height - 2, box.Width - 1, box.Height - 2);
-		}
-	}
-}
+    internal class ThemeManager
+    {
+        public static Color MainColorDark = Color.Black;
+        public static Color BackColorDark = Color.FromArgb(32, 32, 32);
+        public static Color SecondColorDark = Color.FromArgb(56, 56, 56);
+        public static Color AccentColorDark = Color.FromArgb(73, 169, 207);
+
+        private enum WindowCompositionAttribute
+        {
+            WCA_UNDEFINED = 0,
+            WCA_NCRENDERING_ENABLED = 1,
+            WCA_NCRENDERING_POLICY = 2,
+            WCA_TRANSITIONS_FORCEDISABLED = 3,
+            WCA_ALLOW_NCPAINT = 4,
+            WCA_CAPTION_BUTTON_BOUNDS = 5,
+            WCA_NONCLIENT_RTL_LAYOUT = 6,
+            WCA_FORCE_ICONIC_REPRESENTATION = 7,
+            WCA_EXTENDED_FRAME_BOUNDS = 8,
+            WCA_HAS_ICONIC_BITMAP = 9,
+            WCA_THEME_ATTRIBUTES = 10,
+            WCA_NCRENDERING_EXILED = 11,
+            WCA_NCADORNMENTINFO = 12,
+            WCA_EXCLUDED_FROM_LIVEPREVIEW = 13,
+            WCA_VIDEO_OVERLAY_ACTIVE = 14,
+            WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15,
+            WCA_DISALLOW_PEEK = 16,
+            WCA_CLOAK = 17,
+            WCA_CLOAKED = 18,
+            WCA_ACCENT_POLICY = 19,
+            WCA_FREEZE_REPRESENTATION = 20,
+            WCA_EVER_UNCLOAKED = 21,
+            WCA_VISUAL_OWNER = 22,
+            WCA_HOLOGRAPHIC = 23,
+            WCA_EXCLUDED_FROM_DDA = 24,
+            WCA_PASSIVEUPDATEMODE = 25,
+            WCA_USEDARKMODECOLORS = 26,
+            WCA_LAST = 27
+        };
+
+        private struct WindowCompositionAttribData
+        {
+            public WindowCompositionAttribute Attribute;
+            public IntPtr Data;
+            public int SizeOfData;
+        }
+
+        [DllImport("uxtheme.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+        private static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
+
+        [DllImport("uxtheme.dll", EntryPoint = "#133", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
+        private static extern bool AllowDarkModeForWindow(IntPtr hWnd, bool allow);
+
+        [DllImport("uxtheme.dll", EntryPoint = "#135", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
+        private static extern bool AllowDarkModeForApp(bool allow);
+
+        [DllImport("user32.dll")]
+        private static extern bool SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttribData data);
+
+        private static void enableDarkTitlebar(IntPtr handle, bool dark)
+        {
+            AllowDarkModeForWindow(handle, dark);
+
+            var sizeOfData = Marshal.SizeOf(dark);
+            var dataPtr = Marshal.AllocHGlobal(sizeOfData);
+
+            var data = new WindowCompositionAttribData
+            {
+                Attribute = WindowCompositionAttribute.WCA_USEDARKMODECOLORS,
+                Data = dataPtr,
+                SizeOfData = sizeOfData
+            };
+            SetWindowCompositionAttribute(handle, ref data);
+
+            Marshal.FreeHGlobal(dataPtr);
+        }
+
+        public static void allowDarkModeForApp(bool dark)
+        {
+            AllowDarkModeForApp(dark);
+        }
+
+        public static void formHandleCreated(object sender, EventArgs e)
+        {
+            Form f = sender as Form;
+            enableDarkTitlebar(f.Handle, true);
+        }
+
+        public static void setDarkModeToControl(IntPtr handle)
+        {
+            SetWindowTheme(handle, "DarkMode_Explorer", null);
+        }
+
+        public static bool isDarkTheme()
+        {
+            if (isWindows10())
+            {
+                try
+                {
+                    string root = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
+                    string str = Registry.GetValue(root, "AppsUseLightTheme", null).ToString();
+                    return (str == "0");
+                }
+                catch
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public static bool isWindows10()
+        {
+            try
+            {
+                var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
+                string productName = (string)reg.GetValue("ProductName");
+                return productName.StartsWith("Windows 10");
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        public static void PaintDarkGroupBox(object sender, PaintEventArgs p)
+        {
+            GroupBox box = (GroupBox)sender;
+
+            SolidBrush brush = new SolidBrush(ThemeManager.SecondColorDark);
+            Pen pen = new Pen(brush, 1);
+
+            p.Graphics.Clear(ThemeManager.BackColorDark);
+
+            p.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
+            p.Graphics.DrawString(box.Text, box.Font, Brushes.White, -1, -3);
+
+            p.Graphics.DrawLine(pen, 0, 16, 0, box.Height - 2);
+            p.Graphics.DrawLine(pen, 0, 16, box.Width - 1, 16);
+            p.Graphics.DrawLine(pen, box.Width - 1, 16, box.Width - 1, box.Height - 2);
+            p.Graphics.DrawLine(pen, 0, box.Height - 2, box.Width - 1, box.Height - 2);
+        }
+    }
+}

+ 67 - 67
quick-color-picker/Utils/Updater/UpdateChecker.cs

@@ -4,81 +4,81 @@ using System.Threading.Tasks;
 
 
 namespace quick_color_picker
 namespace quick_color_picker
 {
 {
-	public class UpdateChecker
-	{
-		private IReleasesClient _releaseClient;
-		internal GitHubClient Github;
+    public class UpdateChecker
+    {
+        private IReleasesClient _releaseClient;
+        internal GitHubClient Github;
 
 
-		internal string CurrentVersion;
-		internal string RepositoryOwner;
-		internal string RepostoryName;
-		internal Release LatestRelease;
+        internal string CurrentVersion;
+        internal string RepositoryOwner;
+        internal string RepostoryName;
+        internal Release LatestRelease;
 
 
-		public UpdateChecker(string owner, string name)
-		{
-			string version = System.Windows.Forms.Application.ProductVersion;
+        public UpdateChecker(string owner, string name)
+        {
+            string version = System.Windows.Forms.Application.ProductVersion;
 
 
-			Github = new GitHubClient(new ProductHeaderValue(name + @"-UpdateCheck"));
-			_releaseClient = Github.Release;
+            Github = new GitHubClient(new ProductHeaderValue(name + @"-UpdateCheck"));
+            _releaseClient = Github.Release;
 
 
-			RepositoryOwner = owner;
-			RepostoryName = name;
-			CurrentVersion = version;
-		}
+            RepositoryOwner = owner;
+            RepostoryName = name;
+            CurrentVersion = version;
+        }
 
 
-		public async Task<bool> CheckUpdate()
-		{
-			var releases = await _releaseClient.GetAll(RepositoryOwner, RepostoryName);
-			LatestRelease = releases[0];
+        public async Task<bool> CheckUpdate()
+        {
+            var releases = await _releaseClient.GetAll(RepositoryOwner, RepostoryName);
+            LatestRelease = releases[0];
 
 
-			string[] curDots = CurrentVersion.Split('.');
-			int curMajor = Convert.ToInt32(curDots[0]);
-			int curMinor = Convert.ToInt32(curDots[1]);
-			int curPatch = Convert.ToInt32(curDots[2]);
+            string[] curDots = CurrentVersion.Split('.');
+            int curMajor = Convert.ToInt32(curDots[0]);
+            int curMinor = Convert.ToInt32(curDots[1]);
+            int curPatch = Convert.ToInt32(curDots[2]);
 
 
-			for (int i = 0; i < releases.Count; i++)
-			{
-				string[] dots = releases[i].TagName.Substring(1, releases[i].TagName.Length - 1).Split('.');
-				int major = Convert.ToInt32(dots[0]);
-				int minor = Convert.ToInt32(dots[1]);
-				int patch = Convert.ToInt32(dots[2]);
+            for (int i = 0; i < releases.Count; i++)
+            {
+                string[] dots = releases[i].TagName.Substring(1, releases[i].TagName.Length - 1).Split('.');
+                int major = Convert.ToInt32(dots[0]);
+                int minor = Convert.ToInt32(dots[1]);
+                int patch = Convert.ToInt32(dots[2]);
 
 
-				if (major > curMajor)
-				{
-					return true;
-				}
-				else if (major == curMajor)
-				{
-					if (minor > curMinor)
-					{
-						return true;
-					}
-					else if (minor == curMinor)
-					{
-						if (patch > curPatch)
-						{
-							return true;
-						}
-					}
-				}
-			}
+                if (major > curMajor)
+                {
+                    return true;
+                }
+                else if (major == curMajor)
+                {
+                    if (minor > curMinor)
+                    {
+                        return true;
+                    }
+                    else if (minor == curMinor)
+                    {
+                        if (patch > curPatch)
+                        {
+                            return true;
+                        }
+                    }
+                }
+            }
 
 
-			return false;
-		}
+            return false;
+        }
 
 
-		public async Task<string> RenderReleaseNotes()
-		{
-			if (LatestRelease == null)
-			{
-				throw new InvalidOperationException();
-			}
-			return await Github.Miscellaneous.RenderRawMarkdown(LatestRelease.Body);
-		}
+        public async Task<string> RenderReleaseNotes()
+        {
+            if (LatestRelease == null)
+            {
+                throw new InvalidOperationException();
+            }
+            return await Github.Miscellaneous.RenderRawMarkdown(LatestRelease.Body);
+        }
 
 
-		public string GetAssetUrl(string assetname)
-		{
-			const string template = "https://github.com/{0}/{1}/releases/download/{2}/{3}";
-			return string.Format(template, RepositoryOwner, RepostoryName, LatestRelease.TagName, assetname);
-		}
-	}
-}
+        public string GetAssetUrl(string assetname)
+        {
+            const string template = "https://github.com/{0}/{1}/releases/download/{2}/{3}";
+            return string.Format(template, RepositoryOwner, RepostoryName, LatestRelease.TagName, assetname);
+        }
+    }
+}

+ 3 - 3
quick-color-picker/Views/DownloadForm.cs

@@ -1,9 +1,9 @@
 using System;
 using System;
 using System.ComponentModel;
 using System.ComponentModel;
-using System.Windows.Forms;
-using System.Net;
 using System.Diagnostics;
 using System.Diagnostics;
 using System.Drawing;
 using System.Drawing;
+using System.Net;
+using System.Windows.Forms;
 
 
 namespace quick_color_picker
 namespace quick_color_picker
 {
 {
@@ -75,4 +75,4 @@ namespace quick_color_picker
             wc.CancelAsync();
             wc.CancelAsync();
         }
         }
     }
     }
-}
+}

+ 48 - 48
quick-color-picker/Views/UpdateForm.cs

@@ -4,64 +4,64 @@ using System.Windows.Forms;
 
 
 namespace quick_color_picker
 namespace quick_color_picker
 {
 {
-	public partial class UpdateForm : Form
-	{
-		private readonly UpdateChecker _checker;
-		private bool _loadednotes;
+    public partial class UpdateForm : Form
+    {
+        private readonly UpdateChecker _checker;
+        private bool _loadednotes;
 
 
-		public UpdateForm(UpdateChecker checker, string appName, bool darkMode)
-		{
-			if (darkMode)
-			{
-				this.HandleCreated += new EventHandler(ThemeManager.formHandleCreated);
-			}
+        public UpdateForm(UpdateChecker checker, string appName, bool darkMode)
+        {
+            if (darkMode)
+            {
+                this.HandleCreated += new EventHandler(ThemeManager.formHandleCreated);
+            }
 
 
-			_checker = checker;
+            _checker = checker;
 
 
-			InitializeComponent();
+            InitializeComponent();
 
 
-			this.Height = 179;
+            this.Height = 179;
 
 
-			label1.Text = string.Format(label1.Text, appName);
-			currentLabel.Text = string.Format(currentLabel.Text, _checker.CurrentVersion);
-			latestLabel.Text = string.Format(latestLabel.Text, _checker.LatestRelease.TagName);
+            label1.Text = string.Format(label1.Text, appName);
+            currentLabel.Text = string.Format(currentLabel.Text, _checker.CurrentVersion);
+            latestLabel.Text = string.Format(latestLabel.Text, _checker.LatestRelease.TagName);
 
 
-			if (darkMode)
-			{
-				this.BackColor = ThemeManager.BackColorDark;
-				this.ForeColor = Color.White;
+            if (darkMode)
+            {
+                this.BackColor = ThemeManager.BackColorDark;
+                this.ForeColor = Color.White;
 
 
-				buttonYes.BackColor = ThemeManager.SecondColorDark;
-				buttonNo.BackColor = ThemeManager.SecondColorDark;
-				boxReleaseNotes.BackColor = ThemeManager.SecondColorDark;
-			}
-		}
+                buttonYes.BackColor = ThemeManager.SecondColorDark;
+                buttonNo.BackColor = ThemeManager.SecondColorDark;
+                boxReleaseNotes.BackColor = ThemeManager.SecondColorDark;
+            }
+        }
 
 
-		async void boxReleaseNotes_CheckedChanged(object sender, EventArgs e)
-		{
-			if (boxReleaseNotes.Checked)
-			{
-				this.Height = 386;
-			}
-			else
-			{
-				this.Height = 179;
-			}
+        private async void boxReleaseNotes_CheckedChanged(object sender, EventArgs e)
+        {
+            if (boxReleaseNotes.Checked)
+            {
+                this.Height = 386;
+            }
+            else
+            {
+                this.Height = 179;
+            }
 
 
-			ReleaseNotes.Visible = boxReleaseNotes.Checked;
+            ReleaseNotes.Visible = boxReleaseNotes.Checked;
 
 
-			if (_loadednotes) return;
+            if (_loadednotes) return;
 
 
-			ReleaseNotes.DocumentText = await _checker.RenderReleaseNotes();
-			_loadednotes = true;
-		}
+            ReleaseNotes.DocumentText = await _checker.RenderReleaseNotes();
+            _loadednotes = true;
+        }
 
 
-		private void UpdateForm_KeyDown(object sender, KeyEventArgs e)
-		{
-			if (e.KeyCode == Keys.Escape)
-			{
-				this.Close();
-			}
-		}
-	}
+        private void UpdateForm_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Escape)
+            {
+                this.Close();
+            }
+        }
+    }
 }
 }