diff --git a/HelpersLib/CodeMenu.cs b/HelpersLib/CodeMenu.cs index 48c98148a..82ad114a2 100644 --- a/HelpersLib/CodeMenu.cs +++ b/HelpersLib/CodeMenu.cs @@ -47,7 +47,7 @@ public static ContextMenuStrip Create(TextBox tb, params TEntry[] ignore Select(x => new { Name = x.ToPrefixString(), - Description = x.Description, + Description = x.Description }); foreach (var variable in variables) diff --git a/HelpersLib/ColorBgra.cs b/HelpersLib/ColorBgra.cs index 1ac8d066a..ff3275f11 100644 --- a/HelpersLib/ColorBgra.cs +++ b/HelpersLib/ColorBgra.cs @@ -77,7 +77,7 @@ public ColorBgra(Color color) public override bool Equals(object obj) { - return obj != null && obj is ColorBgra && ((ColorBgra)obj).Bgra == Bgra; + return obj is ColorBgra && ((ColorBgra)obj).Bgra == Bgra; } public override int GetHashCode() diff --git a/HelpersLib/Controls/MyListView.cs b/HelpersLib/Controls/MyListView.cs index a44e25010..f446fe1fa 100644 --- a/HelpersLib/Controls/MyListView.cs +++ b/HelpersLib/Controls/MyListView.cs @@ -48,7 +48,7 @@ public class MyListView : ListView private ListViewColumnSorter lvwColumnSorter; private int lineIndex = -1; private int lastLineIndex = -1; - private ListViewItem dragOverItem = null; + private ListViewItem dragOverItem; public MyListView() { @@ -223,10 +223,10 @@ private void DrawInsertionLine(int x1, int x2, int y) { g.DrawLine(Pens.LightBlue, x1, y, x2 - 1, y); - Point[] leftTriangle = new Point[3] { new Point(x1, y - 4), new Point(x1 + 7, y), new Point(x1, y + 4) }; + Point[] leftTriangle = new Point[] { new Point(x1, y - 4), new Point(x1 + 7, y), new Point(x1, y + 4) }; g.FillPolygon(Brushes.LightBlue, leftTriangle); - Point[] rightTriangle = new Point[3] { new Point(x2, y - 4), new Point(x2 - 8, y), new Point(x2, y + 4) }; + Point[] rightTriangle = new Point[] { new Point(x2, y - 4), new Point(x2 - 8, y), new Point(x2, y + 4) }; g.FillPolygon(Brushes.LightBlue, rightTriangle); } } diff --git a/HelpersLib/DWMManager.cs b/HelpersLib/DWMManager.cs index f8434b461..012ae8332 100644 --- a/HelpersLib/DWMManager.cs +++ b/HelpersLib/DWMManager.cs @@ -29,8 +29,8 @@ namespace HelpersLib { public class DWMManager : IDisposable { - private bool isDWMEnabled = false; - private bool autoEnable = false; + private bool isDWMEnabled; + private bool autoEnable; public DWMManager() { diff --git a/HelpersLib/Helpers/ImageHelpers.cs b/HelpersLib/Helpers/ImageHelpers.cs index 31da6dfb4..3e255b063 100644 --- a/HelpersLib/Helpers/ImageHelpers.cs +++ b/HelpersLib/Helpers/ImageHelpers.cs @@ -675,7 +675,7 @@ public static Bitmap RotateImage(Image inputImage, float angleDegrees, bool upsi IniConfig.Init(configPath); } - using (Image cloneImage = img != null ? (Image)img.Clone() : ImageHelpers.LoadImage(imgPath)) + using (Image cloneImage = img != null ? (Image)img.Clone() : LoadImage(imgPath)) using (ICapture capture = new Capture { Image = cloneImage }) using (Surface surface = new Surface(capture)) using (ImageEditorForm editor = new ImageEditorForm(surface, true)) @@ -697,7 +697,8 @@ public static Bitmap RotateImage(Image inputImage, float angleDegrees, bool upsi return editor.GetImageForExport(); } } - else if (result == DialogResult.Abort) + + if (result == DialogResult.Abort) { return null; } diff --git a/HelpersLib/Helpers/URLHelpers.cs b/HelpersLib/Helpers/URLHelpers.cs index 858f2e768..e7fdfbdc2 100644 --- a/HelpersLib/Helpers/URLHelpers.cs +++ b/HelpersLib/Helpers/URLHelpers.cs @@ -288,7 +288,7 @@ public static List GetPaths(string path) public static string FixPrefix(string url) { - if (!URLHelpers.HasPrefix(url)) + if (!HasPrefix(url)) { return "http://" + url; } diff --git a/HelpersLib/Native/LayeredForm.cs b/HelpersLib/Native/LayeredForm.cs index e00095c6b..d56a095a8 100644 --- a/HelpersLib/Native/LayeredForm.cs +++ b/HelpersLib/Native/LayeredForm.cs @@ -30,7 +30,7 @@ namespace HelpersLib { - public partial class LayeredForm : Form + public class LayeredForm : Form { public LayeredForm() { diff --git a/HelpersLib/Native/NativeMethods_Helpers.cs b/HelpersLib/Native/NativeMethods_Helpers.cs index 858f129bb..d3d0235ce 100644 --- a/HelpersLib/Native/NativeMethods_Helpers.cs +++ b/HelpersLib/Native/NativeMethods_Helpers.cs @@ -452,10 +452,8 @@ public static bool Is64Bit() { return true; } - else - { - return false; - } + + return false; } private static bool Is32BitProcessOn64BitProcessor() diff --git a/HelpersLib/Native/NativeStructs.cs b/HelpersLib/Native/NativeStructs.cs index 8f4e0a9b9..99b28358c 100644 --- a/HelpersLib/Native/NativeStructs.cs +++ b/HelpersLib/Native/NativeStructs.cs @@ -115,7 +115,8 @@ public override bool Equals(object obj) { return Equals((RECT)obj); } - else if (obj is Rectangle) + + if (obj is Rectangle) { return Equals(new RECT((Rectangle)obj)); } diff --git a/HelpersLib/PingHelper.cs b/HelpersLib/PingHelper.cs index 98c543a56..55bdbc0d6 100644 --- a/HelpersLib/PingHelper.cs +++ b/HelpersLib/PingHelper.cs @@ -69,7 +69,7 @@ public static PingResult PingHost(string host, int timeout = 1000, int pingCount private static IPAddress GetIpFromHost(string host) { - IPAddress address = null; + IPAddress address; if (!IPAddress.TryParse(host, out address)) { diff --git a/HelpersLib/UnsafeBitmap.cs b/HelpersLib/UnsafeBitmap.cs index 7445cbcda..c29cee22a 100644 --- a/HelpersLib/UnsafeBitmap.cs +++ b/HelpersLib/UnsafeBitmap.cs @@ -92,7 +92,7 @@ public void Unlock() public override bool Equals(object obj) { - return obj != null && obj is UnsafeBitmap && Compare((UnsafeBitmap)obj, this); + return obj is UnsafeBitmap && Compare((UnsafeBitmap)obj, this); } public override int GetHashCode() diff --git a/HelpersLib/Vector2.cs b/HelpersLib/Vector2.cs index 25d2bef60..e9c7bc04a 100644 --- a/HelpersLib/Vector2.cs +++ b/HelpersLib/Vector2.cs @@ -92,7 +92,7 @@ public override string ToString() public static bool operator !=(Vector2 u, Vector2 v) { - return u != v; + return !(u == v); } public static Vector2 operator +(Vector2 u, Vector2 v) diff --git a/HistoryLib/HistoryForm.cs b/HistoryLib/HistoryForm.cs index 66bae62b3..1386aa226 100644 --- a/HistoryLib/HistoryForm.cs +++ b/HistoryLib/HistoryForm.cs @@ -26,7 +26,6 @@ using HelpersLib; using HistoryLib.Properties; using System; -using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/HistoryLib/HistoryForm.resx b/HistoryLib/HistoryForm.resx index a8b0a2ae1..60747f4df 100644 --- a/HistoryLib/HistoryForm.resx +++ b/HistoryLib/HistoryForm.resx @@ -119,10 +119,10 @@ - 56, 46 + 88, 46 - 230, 20 + 206, 20 @@ -222,10 +222,10 @@ 9 - 56, 70 + 88, 70 - 230, 20 + 206, 20 4 @@ -434,90 +434,6 @@ 3 - - btnRemoveFilters - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 0 - - - txtHostFilter - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 2 - - - cbTypeFilterSelection - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 3 - - - cbHostFilter - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 4 - - - cbTypeFilter - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 5 - - - 8, 8 - - - 312, 272 - - - 2 - - - Filters - - - gbFilters - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 160, 232 @@ -647,31 +563,34 @@ 5 + + 8, 8 + + + 312, 272 + + + 2 + + + Filters + + + gbFilters + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + Top, Bottom, Left, Right - - 8, 288 - - - 904, 368 - - - 0 - - - lvHistory - - - HelpersLib.MyListView, HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 0 - Date & time @@ -698,10 +617,31 @@ URL - @Invariant + 330 + + 8, 288 + + + 904, 368 + + + 0 + + + lvHistory + + + HelpersLib.MyListView, HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + Top, Left, Right diff --git a/HistoryLib/HistoryForm.tr.resx b/HistoryLib/HistoryForm.tr.resx index a7f68ec23..ff9ae850b 100644 --- a/HistoryLib/HistoryForm.tr.resx +++ b/HistoryLib/HistoryForm.tr.resx @@ -117,26 +117,27 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Geçmiş - - - Filtreleri uygula - - - Filtreleri kaldır + + + 82, 17 Tarih filtresi: - - Dosya adı filtresi: + + 49, 13 - - Büyük küçük duyarlı + + Tarihten: - - Aktif kültür + + 40, 13 + + + Tarihe: + + + Filtreleri uygula İçeren @@ -150,6 +151,36 @@ Tam eşleşme + + Aktif kültür + + + Değişmez kültür (İngilizce) + + + Sıra (İngilizce) + + + 105, 17 + + + Dosya adı filtresi: + + + 122, 17 + + + Büyük küçük duyarlı + + + 44, 17 + + + Durum + + + Filtreleri kaldır + Resim @@ -159,6 +190,21 @@ Yazı + + 95, 17 + + + Sunucu filtresi: + + + 109, 17 + + + Dosya türü filtresi: + + + Filtreler + Tarih & saat @@ -168,31 +214,10 @@ Tür - - Filtreler - - - Durum - - - Değişmez kültür (İngilizce) - - - Sıra (İngilizce) - - - Dosya türü filtresi: - - - Sunucu filtresi: - Sunucu - - Tarihten: - - - Tarihe: + + Geçmiş \ No newline at end of file diff --git a/ImageEffectsLib/Drawings/DrawBackground.cs b/ImageEffectsLib/Drawings/DrawBackground.cs index 5e22fca40..949b8a80a 100644 --- a/ImageEffectsLib/Drawings/DrawBackground.cs +++ b/ImageEffectsLib/Drawings/DrawBackground.cs @@ -57,10 +57,8 @@ public override Image Apply(Image img) { return ImageHelpers.FillBackground(img, Color, Color2, GradientType); } - else - { - return ImageHelpers.FillBackground(img, Color); - } + + return ImageHelpers.FillBackground(img, Color); } } } \ No newline at end of file diff --git a/ImageEffectsLib/Drawings/DrawBorder.cs b/ImageEffectsLib/Drawings/DrawBorder.cs index 5a735a417..5ba9724f0 100644 --- a/ImageEffectsLib/Drawings/DrawBorder.cs +++ b/ImageEffectsLib/Drawings/DrawBorder.cs @@ -75,10 +75,8 @@ public override Image Apply(Image img) { return ImageHelpers.DrawBorder(img, Color, Color2, GradientType, Size, Type); } - else - { - return ImageHelpers.DrawBorder(img, Color, Size, Type); - } + + return ImageHelpers.DrawBorder(img, Color, Size, Type); } } } \ No newline at end of file diff --git a/ImageEffectsLib/Drawings/DrawText.cs b/ImageEffectsLib/Drawings/DrawText.cs index 022afec0e..3fb311ae3 100644 --- a/ImageEffectsLib/Drawings/DrawText.cs +++ b/ImageEffectsLib/Drawings/DrawText.cs @@ -24,7 +24,6 @@ #endregion License Information (GPL v3) using HelpersLib; -using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; diff --git a/ScreenCaptureLib/RegionHelpers/ResizeManager.cs b/ScreenCaptureLib/RegionHelpers/ResizeManager.cs index 1b8d901aa..5afc32aa6 100644 --- a/ScreenCaptureLib/RegionHelpers/ResizeManager.cs +++ b/ScreenCaptureLib/RegionHelpers/ResizeManager.cs @@ -56,14 +56,12 @@ public bool Visible public int MinMoveSpeed { get; set; } public bool IsBottomRightResizing { get; set; } - private Surface surface; private AreaManager areaManager; private NodeObject[] nodes; private Rectangle tempRect; public ResizeManager(Surface surface, AreaManager areaManager) { - this.surface = surface; this.areaManager = areaManager; MinMoveSpeed = surface.Config.MinMoveSpeed; diff --git a/ScreenCaptureLib/Screencast/FFmpegHelper.cs b/ScreenCaptureLib/Screencast/FFmpegHelper.cs index b41dc7768..52cfce196 100644 --- a/ScreenCaptureLib/Screencast/FFmpegHelper.cs +++ b/ScreenCaptureLib/Screencast/FFmpegHelper.cs @@ -158,7 +158,8 @@ public DirectShowDevices GetDirectShowDevices() isVideo = true; continue; } - else if (line.EndsWith("] DirectShow audio devices", StringComparison.InvariantCulture)) + + if (line.EndsWith("] DirectShow audio devices", StringComparison.InvariantCulture)) { isVideo = false; continue; diff --git a/ShareX.sln.DotSettings b/ShareX.sln.DotSettings index c58b3d581..c0690b9be 100644 --- a/ShareX.sln.DotSettings +++ b/ShareX.sln.DotSettings @@ -20,6 +20,7 @@ DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW + DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW diff --git a/ShareX.zreproj b/ShareX.zreproj deleted file mode 100644 index 847089416..000000000 --- a/ShareX.zreproj +++ /dev/null @@ -1,458 +0,0 @@ - - - - <XtraSerializer version="1.0" application="View"> - <property name="#LayoutVersion" /> - <property name="ActiveFilterString" /> -</XtraSerializer> - <XtraSerializer version="1.0" application="View"> - <property name="#LayoutVersion" /> -</XtraSerializer> - 0 - True - False - False - True - True - True - [basename][optionaldefaulttypes].[extension] - [basename][optionaldefaulttypes].[languagecode].[extension] - 0 - .aspx;.ascx;.asmx;.master;.sitemap - True - True - False - <?xml version='1.0' encoding='utf-8'?><items /> - #### - False - 0 - 115 - False - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ShareX/Controls/BeforeUploadControl.cs b/ShareX/Controls/BeforeUploadControl.cs index 1bfd397a5..3db69a28a 100644 --- a/ShareX/Controls/BeforeUploadControl.cs +++ b/ShareX/Controls/BeforeUploadControl.cs @@ -64,8 +64,8 @@ public void Init(TaskInfo info) flp.Controls.OfType().ForEach(x => { - x.Checked = (x.Tag is TextDestination && (TextDestination)x.Tag == (TextDestination)info.TaskSettings.TextDestination) || - (x.Tag is FileDestination && (FileDestination)x.Tag == (FileDestination)info.TaskSettings.TextFileDestination); + x.Checked = (x.Tag is TextDestination && (TextDestination)x.Tag == info.TaskSettings.TextDestination) || + (x.Tag is FileDestination && (FileDestination)x.Tag == info.TaskSettings.TextFileDestination); }); break; case EDataType.File: @@ -76,7 +76,7 @@ public void Init(TaskInfo info) flp.Controls.OfType().ForEach(x => { - x.Checked = x.Tag is FileDestination && (FileDestination)x.Tag == (FileDestination)info.TaskSettings.FileDestination; + x.Checked = x.Tag is FileDestination && (FileDestination)x.Tag == info.TaskSettings.FileDestination; }); break; case EDataType.URL: @@ -87,7 +87,7 @@ public void Init(TaskInfo info) flp.Controls.OfType().ForEach(x => { - x.Checked = x.Tag is UrlShortenerType && (UrlShortenerType)x.Tag == (UrlShortenerType)info.TaskSettings.URLShortenerDestination; + x.Checked = x.Tag is UrlShortenerType && (UrlShortenerType)x.Tag == info.TaskSettings.URLShortenerDestination; }); break; @@ -113,8 +113,8 @@ public void InitCapture(TaskSettings taskSettings) flp.Controls.OfType().ForEach(x => { - x.Checked = (x.Tag is ImageDestination && (ImageDestination)x.Tag == (ImageDestination)taskSettings.ImageDestination) || - (x.Tag is FileDestination && (FileDestination)x.Tag == (FileDestination)taskSettings.ImageFileDestination); + x.Checked = (x.Tag is ImageDestination && (ImageDestination)x.Tag == taskSettings.ImageDestination) || + (x.Tag is FileDestination && (FileDestination)x.Tag == taskSettings.ImageFileDestination); }); } diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index 48486b2bc..7fe0b0624 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -95,7 +95,7 @@ private void rtb_LinkClicked(object sender, LinkClickedEventArgs e) private int direction = speed; private Color lineColor = new HSB(0d, 1d, 0.9d); private bool isPaused; - private int clickCount = 0; + private int clickCount; private void cLogo_Draw(Graphics g) { diff --git a/ShareX/Forms/BeforeUploadForm.cs b/ShareX/Forms/BeforeUploadForm.cs index 8fb0b7276..98122e2f0 100644 --- a/ShareX/Forms/BeforeUploadForm.cs +++ b/ShareX/Forms/BeforeUploadForm.cs @@ -38,7 +38,7 @@ public BeforeUploadForm(TaskInfo info) Icon = ShareXResources.Icon; DialogResult = DialogResult.OK; - ucBeforeUpload.InitCompleted += (currentDestination) => + ucBeforeUpload.InitCompleted += currentDestination => { string title = string.IsNullOrEmpty(currentDestination) ? Resources.BeforeUploadForm_BeforeUploadForm_Please_choose_a_destination_ : Resources.BeforeUploadForm_BeforeUploadForm__0__is_about_to_be_uploaded_to__1___You_may_choose_a_different_destination_; diff --git a/ShareX/Forms/DropForm.cs b/ShareX/Forms/DropForm.cs index dd5ecad8b..af0a42479 100644 --- a/ShareX/Forms/DropForm.cs +++ b/ShareX/Forms/DropForm.cs @@ -32,7 +32,7 @@ namespace ShareX { - public partial class DropForm : LayeredForm + public class DropForm : LayeredForm { private static DropForm instance; @@ -52,8 +52,8 @@ public static DropForm GetInstance(int size, int offset, ContentAlignment alignm public int DropOpacity { get; set; } public int DropHoverOpacity { get; set; } - private Bitmap backgroundImage = null; - private bool isHovered = false; + private Bitmap backgroundImage; + private bool isHovered; private DropForm(int size, int offset, ContentAlignment alignment, int opacity, int hoverOpacity) { diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index 7564dd412..69aec309a 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -217,7 +217,7 @@ private ToolStripMenuItem WorkflowMenuItem(HotkeySettings hotkeySetting) ToolStripMenuItem tsmi = new ToolStripMenuItem(hotkeySetting.TaskSettings.Description); if (hotkeySetting.HotkeyInfo.IsValidHotkey) { - tsmi.ShortcutKeyDisplayString = " " + hotkeySetting.HotkeyInfo.ToString(); + tsmi.ShortcutKeyDisplayString = " " + hotkeySetting.HotkeyInfo; } if (!hotkeySetting.TaskSettings.IsUsingDefaultSettings) { @@ -1504,7 +1504,7 @@ private void ExecuteJob(TaskSettings taskSettings, HotkeyType job) TaskHelpers.OpenScreenshotsFolder(); break; case HotkeyType.ScreenColorPicker: - TaskHelpers.OpenScreenColorPicker(safeTaskSettings); + TaskHelpers.OpenScreenColorPicker(); break; case HotkeyType.Ruler: TaskHelpers.OpenRuler(); diff --git a/ShareX/Forms/NotificationForm.cs b/ShareX/Forms/NotificationForm.cs index 857b33025..29480f812 100644 --- a/ShareX/Forms/NotificationForm.cs +++ b/ShareX/Forms/NotificationForm.cs @@ -31,13 +31,13 @@ namespace ShareX { - public partial class NotificationForm : Form + public class NotificationForm : Form { public NotificationFormConfig ToastConfig { get; private set; } private int windowOffset = 3; - private bool mouseInside = false; - private bool durationEnd = false; + private bool mouseInside; + private bool durationEnd; private bool closingAnimation = true; private int closingAnimationDuration = 2000; private int closingAnimationInterval = 50; diff --git a/ShareX/Forms/ScreenRecordForm.cs b/ShareX/Forms/ScreenRecordForm.cs index b7d018c38..dd9330e89 100644 --- a/ShareX/Forms/ScreenRecordForm.cs +++ b/ShareX/Forms/ScreenRecordForm.cs @@ -81,7 +81,8 @@ public void StartRecording(TaskSettings taskSettings) "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } - else if (!Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].IsValid()) + + if (!Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].IsValid()) { MessageBox.Show(Resources.ScreenRecordForm_StartRecording_CLI_video_encoder_file_does_not_exist__ + Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].Path, diff --git a/ShareX/Forms/TaskSettingsForm.cs b/ShareX/Forms/TaskSettingsForm.cs index 2c10c14d6..4c1484815 100644 --- a/ShareX/Forms/TaskSettingsForm.cs +++ b/ShareX/Forms/TaskSettingsForm.cs @@ -937,7 +937,7 @@ private void lvWatchFolderList_MouseDoubleClick(object sender, MouseEventArgs e) { lvi.Text = watchFolder.FolderPath ?? ""; lvi.SubItems[1].Text = watchFolder.Filter ?? ""; - lvi.SubItems[2].Text = watchFolder.IncludeSubdirectories.ToString() ?? ""; + lvi.SubItems[2].Text = watchFolder.IncludeSubdirectories.ToString(); } } } diff --git a/ShareX/LanguageHelper.cs b/ShareX/LanguageHelper.cs index c1ec06674..1ef14a44b 100644 --- a/ShareX/LanguageHelper.cs +++ b/ShareX/LanguageHelper.cs @@ -62,7 +62,7 @@ public static bool ChangeLanguage(SupportedLanguage language, params Form[] form currentCulture = CultureInfo.GetCultureInfo(cultureName); } - if (currentCulture.CompareInfo != Thread.CurrentThread.CurrentUICulture.CompareInfo) + if (!currentCulture.Equals(Thread.CurrentThread.CurrentUICulture)) { Thread.CurrentThread.CurrentUICulture = currentCulture; DebugHelper.WriteLine("Language changed to: " + currentCulture.DisplayName); diff --git a/ShareX/Program.cs b/ShareX/Program.cs index 0f926d3db..d1218aeb6 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -306,7 +306,7 @@ private static void Run() } catch (Exception e) { - MessageBox.Show(Resources.Program_Run_Unable_to_create_folder_ + string.Format(" \"{0}\"\r\n\r\n{1}", PersonalPath, e.ToString()), + MessageBox.Show(Resources.Program_Run_Unable_to_create_folder_ + string.Format(" \"{0}\"\r\n\r\n{1}", PersonalPath, e), "ShareX - " + Resources.Program_Run_Error, MessageBoxButtons.OK, MessageBoxIcon.Error); CustomPersonalPath = ""; } @@ -328,7 +328,7 @@ private static void Run() UploaderSettingsResetEvent = new ManualResetEvent(false); HotkeySettingsResetEvent = new ManualResetEvent(false); - TaskEx.Run(() => LoadSettings()); + TaskEx.Run(LoadSettings); LanguageHelper.ChangeLanguage(Settings.Language); @@ -513,11 +513,11 @@ private static void OnError(Exception e) public static void ConfigureUploadersConfigWatcher() { - if (Program.Settings.DetectUploaderConfigFileChanges && uploaderConfigWatcher == null) + if (Settings.DetectUploaderConfigFileChanges && uploaderConfigWatcher == null) { - uploaderConfigWatcher = new FileSystemWatcher(Path.GetDirectoryName(Program.UploadersConfigFilePath), Path.GetFileName(Program.UploadersConfigFilePath)); + uploaderConfigWatcher = new FileSystemWatcher(Path.GetDirectoryName(UploadersConfigFilePath), Path.GetFileName(UploadersConfigFilePath)); uploaderConfigWatcher.Changed += uploaderConfigWatcher_Changed; - uploaderConfigWatcherTimer = new WatchFolderDuplicateEventTimer(Program.UploadersConfigFilePath); + uploaderConfigWatcherTimer = new WatchFolderDuplicateEventTimer(UploadersConfigFilePath); uploaderConfigWatcher.EnableRaisingEvents = true; } else if (uploaderConfigWatcher != null) @@ -548,7 +548,7 @@ public static void UploadersConfigSaveAsync() TaskEx.Run(() => { - UploadersConfig.Save(Program.UploadersConfigFilePath); + UploadersConfig.Save(UploadersConfigFilePath); }, () => { diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index 805b982ca..0b8998282 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -32,7 +32,6 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; -using System.Drawing.Text; using System.IO; using System.Windows.Forms; using UploadersLib; @@ -76,7 +75,7 @@ public static string CreateThumbnail(Image img, string folder, string filename, (img.Width > taskSettings.ImageSettings.ThumbnailWidth && img.Height > taskSettings.ImageSettings.ThumbnailHeight))) { string thumbnailFileName = Path.GetFileNameWithoutExtension(filename) + taskSettings.ImageSettings.ThumbnailName + ".jpg"; - string thumbnailFilePath = TaskHelpers.CheckFilePath(folder, thumbnailFileName, taskSettings); + string thumbnailFilePath = CheckFilePath(folder, thumbnailFileName, taskSettings); if (!string.IsNullOrEmpty(thumbnailFilePath)) { @@ -231,7 +230,7 @@ public static Image AnnotateImage(Image img, string imgPath) Program.MainForm.InvokeSafe(() => newFilePath = ImageHelpers.SaveImageFileDialog(x, filePath)); return newFilePath; }, - x => Program.MainForm.InvokeSafe(() => TaskHelpers.PrintImage(x))); + x => Program.MainForm.InvokeSafe(() => PrintImage(x))); } public static void PrintImage(Image img) @@ -505,10 +504,8 @@ public static void StartAutoCapture() } } - public static void OpenScreenColorPicker(TaskSettings taskSettings = null) + public static void OpenScreenColorPicker() { - if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings(); - new ScreenColorPicker().Show(); } @@ -545,7 +542,7 @@ public static void OpenImageEditor(string filePath = null) if (!string.IsNullOrEmpty(filePath)) { - TaskHelpers.AnnotateImage(filePath); + AnnotateImage(filePath); } } diff --git a/UploadersLib/FileUploaders/Copy.cs b/UploadersLib/FileUploaders/Copy.cs index e552c6896..0fc6bfe63 100644 --- a/UploadersLib/FileUploaders/Copy.cs +++ b/UploadersLib/FileUploaders/Copy.cs @@ -94,7 +94,7 @@ public CopyAccountInfo GetAccountInfo() { string query = OAuthManager.GenerateQuery(URLAccountInfo, null, HttpMethod.GET, AuthInfo); - string response = SendRequest(HttpMethod.GET, query, null, APIHeaders, responseType: ResponseType.Text); + string response = SendRequest(HttpMethod.GET, query, null, APIHeaders); if (!string.IsNullOrEmpty(response)) { diff --git a/UploadersLib/FileUploaders/FTP.cs b/UploadersLib/FileUploaders/FTP.cs index eb04dd0b7..a64783b57 100644 --- a/UploadersLib/FileUploaders/FTP.cs +++ b/UploadersLib/FileUploaders/FTP.cs @@ -92,7 +92,7 @@ public FTP(FTPAccount account) } else { - client.ValidateCertificate += (FtpClient control, FtpSslValidationEventArgs e) => + client.ValidateCertificate += (control, e) => { if (e.PolicyErrors != SslPolicyErrors.None) { diff --git a/UploadersLib/FileUploaders/Pushbullet.cs b/UploadersLib/FileUploaders/Pushbullet.cs index 453ea0456..9852a31aa 100644 --- a/UploadersLib/FileUploaders/Pushbullet.cs +++ b/UploadersLib/FileUploaders/Pushbullet.cs @@ -171,55 +171,40 @@ private class PushbulletResponseDevices private class PushbulletResponseDevice { public string iden { get; set; } - public string nickname { get; set; } } private class PushbulletResponsePush { public string iden { get; set; } - public string device_iden { get; set; } - public PushbulletResponsePushData data { get; set; } - public long created { get; set; } } private class PushbulletResponsePushData { public string type { get; set; } - public string title { get; set; } - public string body { get; set; } } private class PushbulletResponseFileUpload { public string file_type { get; set; } - public string file_name { get; set; } - public string file_url { get; set; } - public string upload_url { get; set; } - public PushbulletResponseFileUploadData data { get; set; } } private class PushbulletResponseFileUploadData { public string awsaccesskeyid { get; set; } - public string acl { get; set; } - public string key { get; set; } - public string signature { get; set; } - public string policy { get; set; } - [JsonProperty("content-type")] public string content_type { get; set; } } @@ -228,7 +213,6 @@ private class PushbulletResponseFileUploadData public class PushbulletDevice { public string Key { get; set; } - public string Name { get; set; } } diff --git a/UploadersLib/Forms/UploadersConfigForm.cs b/UploadersLib/Forms/UploadersConfigForm.cs index 03b555684..e5e8e88e2 100644 --- a/UploadersLib/Forms/UploadersConfigForm.cs +++ b/UploadersLib/Forms/UploadersConfigForm.cs @@ -1156,7 +1156,7 @@ private void lvGoogleDriveFoldersList_SelectedIndexChanged(object sender, EventA if (lvGoogleDriveFoldersList.SelectedItems.Count > 0) { ListViewItem lvi = lvGoogleDriveFoldersList.SelectedItems[0]; - var folder = lvi.Tag as UploadersLib.FileUploaders.GoogleDrive.GoogleDriveFile; + var folder = lvi.Tag as GoogleDrive.GoogleDriveFile; if (folder != null) { txtGoogleDriveFolderID.Text = folder.id; @@ -1403,7 +1403,7 @@ private void FTPAccountRemoveButton_Click(object sender, EventArgs e) private void FTPAccountDuplicateButton_Click(object sender, EventArgs e) { FTPAccount src = (FTPAccount)ucFTPAccounts.lbAccounts.Items[ucFTPAccounts.lbAccounts.SelectedIndex]; - FTPAccount clone = (FTPAccount)src.Clone(); + FTPAccount clone = src.Clone(); AddFTPAccount(clone); } @@ -1897,7 +1897,7 @@ private void LocalhostAccountRemoveButton_Click(object sender, EventArgs e) private void LocalhostAccountDuplicateButton_Click(object sender, EventArgs e) { LocalhostAccount src = (LocalhostAccount)ucLocalhostAccounts.lbAccounts.Items[ucLocalhostAccounts.lbAccounts.SelectedIndex]; - LocalhostAccount clone = (LocalhostAccount)src.Clone(); + LocalhostAccount clone = src.Clone(); Config.LocalhostAccountList.Add(clone); ucLocalhostAccounts.AddItem(clone); } @@ -2066,7 +2066,7 @@ private void TwitterAccountRemoveButton_Click(object sender, EventArgs e) private void TwitterAccountDuplicateButton_Click(object sender, EventArgs e) { OAuthInfo src = (OAuthInfo)ucTwitterAccounts.lbAccounts.Items[ucTwitterAccounts.lbAccounts.SelectedIndex]; - OAuthInfo clone = (OAuthInfo)src.Clone(); + OAuthInfo clone = src.Clone(); Config.TwitterOAuthInfoList.Add(clone); ucTwitterAccounts.AddItem(clone); } diff --git a/UploadersLib/Forms/UploadersConfigFormHelper.cs b/UploadersLib/Forms/UploadersConfigFormHelper.cs index 1c9f05153..c637315ef 100644 --- a/UploadersLib/Forms/UploadersConfigFormHelper.cs +++ b/UploadersLib/Forms/UploadersConfigFormHelper.cs @@ -41,7 +41,7 @@ namespace UploadersLib { - public partial class UploadersConfigForm : Form + public partial class UploadersConfigForm { #region Imgur