diff --git a/ShareX.HelpersLib/Colors/GradientInfo.cs b/ShareX.HelpersLib/Colors/GradientInfo.cs index b824dd1a3..45cac9b63 100644 --- a/ShareX.HelpersLib/Colors/GradientInfo.cs +++ b/ShareX.HelpersLib/Colors/GradientInfo.cs @@ -68,7 +68,9 @@ public void Draw(Graphics g, Rectangle rect) g.FillRectangle(brush, rect); } } - catch { } + catch + { + } } } diff --git a/ShareX.HelpersLib/Native/NativeStructs.cs b/ShareX.HelpersLib/Native/NativeStructs.cs index 45eb06738..11497a72d 100644 --- a/ShareX.HelpersLib/Native/NativeStructs.cs +++ b/ShareX.HelpersLib/Native/NativeStructs.cs @@ -33,7 +33,86 @@ namespace ShareX.HelpersLib [StructLayout(LayoutKind.Sequential)] public struct RECT { - public int Left, Top, Right, Bottom; + public int Left; + public int Top; + public int Right; + public int Bottom; + + public int X + { + get + { + return Left; + } + set + { + Right -= Left - value; + Left = value; + } + } + + public int Y + { + get + { + return Top; + } + set + { + Bottom -= Top - value; + Top = value; + } + } + + public int Width + { + get + { + return Right - Left; + } + set + { + Right = value + Left; + } + } + + public int Height + { + get + { + return Bottom - Top; + } + set + { + Bottom = value + Top; + } + } + + public Point Location + { + get + { + return new Point(Left, Top); + } + set + { + X = value.X; + Y = value.Y; + } + } + + public Size Size + { + get + { + return new Size(Width, Height); + } + set + { + Width = value.Width; + Height = value.Height; + } + } public RECT(int left, int top, int right, int bottom) { @@ -47,42 +126,6 @@ public RECT(Rectangle r) : this(r.Left, r.Top, r.Right, r.Bottom) { } - public int X - { - get { return Left; } - set { Right -= Left - value; Left = value; } - } - - public int Y - { - get { return Top; } - set { Bottom -= Top - value; Top = value; } - } - - public int Width - { - get { return Right - Left; } - set { Right = value + Left; } - } - - public int Height - { - get { return Bottom - Top; } - set { Bottom = value + Top; } - } - - public Point Location - { - get { return new Point(Left, Top); } - set { X = value.X; Y = value.Y; } - } - - public Size Size - { - get { return new Size(Width, Height); } - set { Width = value.Width; Height = value.Height; } - } - public static implicit operator Rectangle(RECT r) { return new Rectangle(r.Left, r.Top, r.Width, r.Height); diff --git a/ShareX.HelpersLib/UpdateChecker/DownloaderForm.cs b/ShareX.HelpersLib/UpdateChecker/DownloaderForm.cs index 6b8188e92..eba92e1b2 100644 --- a/ShareX.HelpersLib/UpdateChecker/DownloaderForm.cs +++ b/ShareX.HelpersLib/UpdateChecker/DownloaderForm.cs @@ -172,7 +172,9 @@ private void RunInstaller() psi.UseShellExecute = true; Process.Start(psi); } - catch { } + catch + { + } } } diff --git a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs index ce0108ebe..c305160da 100644 --- a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs @@ -220,7 +220,9 @@ private void UpdateFFmpegPathUI() backColor = Color.FromArgb(200, 255, 200); } } - catch { } + catch + { + } txtFFmpegPath.BackColor = backColor; #endif diff --git a/ShareX.Steam/Launcher.cs b/ShareX.Steam/Launcher.cs index 26e1a8166..3e3a3ebfd 100644 --- a/ShareX.Steam/Launcher.cs +++ b/ShareX.Steam/Launcher.cs @@ -208,7 +208,9 @@ private static void RunShareX(string arguments = "") return; } } - catch { } + catch + { + } // Workaround 2 string path = Path.Combine(Environment.SystemDirectory, "cmd.exe"); diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index 17da03b26..b2a673c20 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -1021,7 +1021,9 @@ public static void RunShareXAsAdmin(string arguments) psi.Verb = "runas"; Process.Start(psi); } - catch { } + catch + { + } } public static void OpenQRCode()