CodeMaid cleanup

This commit is contained in:
Jaex 2016-07-30 04:21:18 +03:00
parent d6e7c60e7e
commit 0a78019274
59 changed files with 28 additions and 184 deletions

View file

@ -205,8 +205,8 @@ public class CoreConfiguration : IniSection, INotifyPropertyChanged
[IniProperty("OptimizeForRDP", Description = "Make some optimizations for usage with remote desktop", DefaultValue = "False")]
public bool OptimizeForRDP;
[IniProperty("DisableRDPOptimizing", Description = "Disable all optimizations for usage with remote desktop", DefaultValue = "False")]
public bool DisableRDPOptimizing;
[IniProperty("DisableRDPOptimizing", Description = "Disable all optimizations for usage with remote desktop", DefaultValue = "False")]
public bool DisableRDPOptimizing;
[IniProperty("MinimizeWorkingSetSize", Description = "Optimize memory footprint, but with a performance penalty!", DefaultValue = "False")]
public bool MinimizeWorkingSetSize;

View file

@ -101,7 +101,7 @@ private void ComboBox_DrawItem(object sender, DrawItemEventArgs e)
catch
{
if (fontFamily != null)
{
{
// If the drawing failed, BUG-1770 seems to have a weird case that causes: Font 'Lucida Sans Typewriter' does not support style 'Regular'
DrawText(e.Graphics, FontFamily.GenericSansSerif, FontStyle.Regular, e.Bounds, fontFamily.Name);
}

View file

@ -95,7 +95,7 @@ public int Compare(object x, object y)
// Descending sort is selected, return negative result of compare operation
return (-compareResult);
}
// Return '0' to indicate they are equal
return 0;
}

View file

@ -29,7 +29,7 @@ internal class GreenshotComboBox : ComboBox, IGreenshotConfigBindable
{
private Type _enumType = null;
private Enum _selectedEnum = null;
[Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")]
public string SectionName { get; set; } = "Core";

View file

@ -130,7 +130,7 @@ protected override void OnMouseUp(MouseEventArgs e)
//Release Capture should consume MouseUp when canceled with the escape key
User32.ReleaseCapture();
if (PipetteUsed != null)
{
{
PipetteUsed(this, new PipetteUsedArgs(movableShowColorForm.color));
}
}

View file

@ -234,6 +234,5 @@ private void CleanUp()
_eagerlyCreatedDirectory = null;
}
}
}
}

View file

@ -509,7 +509,8 @@ public static string FillCmdVariables(string pattern, bool filenameSafeMode)
}
return CMD_VAR_REGEXP.Replace(pattern,
delegate (Match m) {
delegate (Match m)
{
return MatchVarEvaluator(m, null, processVars, userVars, machineVars, filenameSafeMode);
}
);

View file

@ -1195,7 +1195,7 @@ public static ImageAttributes CreateAdjustAttributes(float brightness, float con
{
float adjustedBrightness = brightness - 1.0f;
ColorMatrix applyColorMatrix = new ColorMatrix(
new [] {
new[] {
new[] {contrast, 0, 0, 0, 0}, // scale red
new[] {0, contrast, 0, 0, 0}, // scale green
new[] {0, 0, contrast, 0, 0}, // scale blue

View file

@ -57,7 +57,8 @@ static NetworkHelper()
try
{
// Disable certificate checking
ServicePointManager.ServerCertificateValidationCallback += delegate {
ServicePointManager.ServerCertificateValidationCallback += delegate
{
return true;
};
}

View file

@ -1,20 +1,20 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2016 Thomas Braun, Jens Klingen, Robin Krom
*
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub: https://github.com/greenshot
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

View file

@ -230,10 +230,10 @@ internal static bool IsIgnoreHandle(IntPtr handle)
private WindowDetails _parent;
private bool _frozen;
/// <summary>
/// This checks if the window is a Windows 8 App
/// For Windows 10 most normal code works, as it's hosted inside "ApplicationFrameWindow"
/// </summary>
/// <summary>
/// This checks if the window is a Windows 8 App
/// For Windows 10 most normal code works, as it's hosted inside "ApplicationFrameWindow"
/// </summary>
public bool IsApp
{
get
@ -1223,7 +1223,7 @@ public ICapture CaptureDwmWindow(ICapture capture, WindowCaptureMode windowCaptu
}
}
}
else if (!Environment.OSVersion.IsWindows8OrLater())
else if (!Environment.OSVersion.IsWindows8OrLater())
{
//GetClientRect(out windowRectangle);
GetBorderSize(out borderSize);

View file

@ -211,7 +211,7 @@ private void TextContainer_FieldChanged(object sender, FieldChangedEventArgs e)
if (e.Field.FieldType.Name.StartsWith("FONT"))
{
if (_font != null)
{
{
_font.Dispose();
_font = null;
}

View file

@ -123,7 +123,7 @@ public ImageEditorForm(ISurface iSurface, bool outputMade)
RECT lastPosition = EditorConfiguration.GetEditorPlacement().NormalPosition;
WindowPlacement wp = new WindowDetails(Handle).WindowPlacement;
wp.NormalPosition.Top = lastPosition.Top ;
wp.NormalPosition.Top = lastPosition.Top;
wp.NormalPosition.Left = lastPosition.Left;
// don't actually show window now (it is done later)
wp.ShowCmd = ShowWindowCommand.Hide;
@ -132,7 +132,7 @@ public ImageEditorForm(ISurface iSurface, bool outputMade)
WindowDetails thisForm = new WindowDetails(Handle)
{
WindowPlacement = wp
WindowPlacement = wp
};
// Once image is loaded into window, size and position window
@ -169,8 +169,7 @@ public ImageEditorForm(ISurface iSurface, bool outputMade)
}
WindowDetails thisForm1 = new WindowDetails(Handle) { WindowPlacement = windowPlacement };
};
}
}
else
{
Load += delegate
@ -229,7 +228,8 @@ private void SetSurface(ISurface newSurface)
{
_surface.TransparencyBackgroundBrush = new TextureBrush(backgroundForTransparency, WrapMode.Tile);
_surface.MovingElementChanged += delegate {
_surface.MovingElementChanged += delegate
{
RefreshEditorControls();
};
_surface.DrawingModeChanged += surface_DrawingModeChanged;

View file

@ -91,7 +91,6 @@ public class SafeHBitmapHandle : SafeObjectHandle
[SecurityCritical]
public SafeHBitmapHandle() : base(true)
{
}
[SecurityCritical]

View file

@ -24,7 +24,6 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib.Properties;
using System;
using System.Drawing;
namespace ShareX.HelpersLib

View file

@ -28,7 +28,6 @@
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
namespace ShareX.HelpersLib

View file

@ -24,7 +24,6 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib.Properties;
using System;
using System.Drawing;
namespace ShareX.HelpersLib

View file

@ -23,7 +23,6 @@
#endregion License Information (GPL v3)
using System;
using System.Drawing;
namespace ShareX.HelpersLib

View file

@ -23,7 +23,6 @@
#endregion License Information (GPL v3)
using System;
using System.Drawing;
namespace ShareX.HelpersLib

View file

@ -23,14 +23,8 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.HelpersLib

View file

@ -24,12 +24,6 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.HelpersLib

View file

@ -23,11 +23,7 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.HelpersLib

View file

@ -23,10 +23,6 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.Design;

View file

@ -23,10 +23,6 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.Design;

View file

@ -23,7 +23,6 @@
#endregion License Information (GPL v3)
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

View file

@ -165,14 +165,13 @@ public static DialogResult Show(string text, string caption, MessageBoxButtons b
private void InitializeComponent()
{
this.SuspendLayout();
//
//
// MyMessageBox
//
//
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Name = "MyMessageBox";
this.ResumeLayout(false);
}
}
}

View file

@ -24,11 +24,8 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.HelpersLib
{

View file

@ -24,7 +24,6 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.IndexerLib.Properties;
using System;
using System.IO;
using System.Windows.Forms;

View file

@ -31,7 +31,6 @@
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Windows.Forms;

View file

@ -30,7 +30,6 @@
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Text;
using System.Windows.Forms;

View file

@ -29,7 +29,6 @@
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib

View file

@ -29,7 +29,6 @@
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib

View file

@ -26,12 +26,8 @@
using ShareX.HelpersLib;
using ShareX.ScreenCaptureLib.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib

View file

@ -25,11 +25,7 @@
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,11 +23,7 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,13 +23,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,13 +23,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,14 +23,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,12 +24,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,13 +24,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,12 +24,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,15 +23,10 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,15 +24,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,11 +23,7 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,13 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,13 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -24,13 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,14 +23,6 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{
public abstract class BaseRegionShape : BaseShape

View file

@ -23,12 +23,8 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,13 +23,6 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{
public class RectangleRegionShape : BaseRegionShape

View file

@ -24,12 +24,8 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -23,11 +23,7 @@
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace ShareX.ScreenCaptureLib
{

View file

@ -31,7 +31,6 @@
using System.Collections.Specialized;
using System.Drawing;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace ShareX.UploadersLib.FileUploaders

View file

@ -26,13 +26,7 @@
using ShareX.HelpersLib;
using ShareX.UploadersLib.OtherServices;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShareX.UploadersLib

View file

@ -24,12 +24,9 @@
#endregion License Information (GPL v3)
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
namespace ShareX.UploadersLib.OtherServices
{

View file

@ -28,7 +28,6 @@
using ShareX.UploadersLib.FileUploaders;
using ShareX.UploadersLib.ImageUploaders;
using ShareX.UploadersLib.TextUploaders;
using System;
using System.Collections.Generic;
namespace ShareX.UploadersLib

View file

@ -25,7 +25,6 @@
using ShareX.HelpersLib;
using ShareX.Properties;
using ShareX.ScreenCaptureLib;
using ShareX.UploadersLib;
using System;
using System.Drawing;

View file

@ -24,7 +24,6 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.Properties;
using System;
using System.Windows.Forms;

View file

@ -26,7 +26,6 @@
using ShareX.HelpersLib;
using ShareX.Properties;
using ShareX.UploadersLib;
using ShareX.UploadersLib.OtherServices;
using System;
using System.Diagnostics;
using System.Drawing;