mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-28 23:42:13 +12:00
CodeMaid cleanup
This commit is contained in:
parent
bbd5cb9f07
commit
e80383968d
23 changed files with 1057 additions and 1074 deletions
|
@ -544,6 +544,14 @@
|
|||
<setting name="Formatting_CommentXmlAlignParamTags" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="Cleaning_InsertBlankLinePaddingBeforePropertiesMultiLine"
|
||||
serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="Cleaning_InsertBlankLinePaddingAfterPropertiesMultiLine"
|
||||
serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</SteveCadwallader.CodeMaid.Properties.Settings>
|
||||
<tomenglertde.ResXManager.View.Properties.Settings>
|
||||
<setting name="ResourceFilter" serializeAs="String">
|
||||
|
|
|
@ -148,7 +148,7 @@ public void Add(TK key, TV value, int? secondsToExpire)
|
|||
lock (lockObject)
|
||||
{
|
||||
var cachedItem = new CachedItem(key, value, secondsToExpire.HasValue ? secondsToExpire.Value : this.secondsToExpire);
|
||||
cachedItem.Expired += delegate(TK cacheKey, TV cacheValue)
|
||||
cachedItem.Expired += delegate (TK cacheKey, TV cacheValue)
|
||||
{
|
||||
if (internalCache.ContainsKey(cacheKey))
|
||||
{
|
||||
|
|
|
@ -478,7 +478,7 @@ public static string FillVariables(string pattern, bool filenameSafeMode)
|
|||
}
|
||||
|
||||
return VAR_REGEXP.Replace(pattern,
|
||||
delegate(Match m)
|
||||
delegate (Match m)
|
||||
{
|
||||
return MatchVarEvaluator(m, null, processVars, userVars, machineVars, filenameSafeMode);
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ public static string FillPattern(string pattern, ICaptureDetails captureDetails,
|
|||
try
|
||||
{
|
||||
return VAR_REGEXP.Replace(pattern,
|
||||
delegate(Match m)
|
||||
delegate (Match m)
|
||||
{
|
||||
return MatchVarEvaluator(m, captureDetails, processVars, userVars, machineVars, filenameSafeMode);
|
||||
}
|
||||
|
|
|
@ -1031,12 +1031,12 @@ public static Bitmap CreateNegative(Image sourceImage)
|
|||
{
|
||||
Bitmap clone = (Bitmap)Clone(sourceImage);
|
||||
ColorMatrix invertMatrix = new ColorMatrix(new[] {
|
||||
new float[] {-1, 0, 0, 0, 0},
|
||||
new float[] {0, -1, 0, 0, 0},
|
||||
new float[] {0, 0, -1, 0, 0},
|
||||
new float[] {0, 0, 0, 1, 0},
|
||||
new float[] {1, 1, 1, 1, 1}
|
||||
});
|
||||
new float[] {-1, 0, 0, 0, 0},
|
||||
new float[] {0, -1, 0, 0, 0},
|
||||
new float[] {0, 0, -1, 0, 0},
|
||||
new float[] {0, 0, 0, 1, 0},
|
||||
new float[] {1, 1, 1, 1, 1}
|
||||
});
|
||||
ApplyColorMatrix(clone, invertMatrix);
|
||||
return clone;
|
||||
}
|
||||
|
@ -1196,12 +1196,12 @@ public static ImageAttributes CreateAdjustAttributes(float brightness, float con
|
|||
float adjustedBrightness = brightness - 1.0f;
|
||||
ColorMatrix applyColorMatrix = new ColorMatrix(
|
||||
new float[][] {
|
||||
new float[] {contrast, 0, 0, 0, 0}, // scale red
|
||||
new float[] {contrast, 0, 0, 0, 0}, // scale red
|
||||
new float[] {0, contrast, 0, 0, 0}, // scale green
|
||||
new float[] {0, 0, contrast, 0, 0}, // scale blue
|
||||
new float[] {0, 0, 0, 1.0f, 0}, // don't scale alpha
|
||||
new float[] {adjustedBrightness, adjustedBrightness, adjustedBrightness, 0, 1}
|
||||
});
|
||||
});
|
||||
|
||||
//create some image attributes
|
||||
ImageAttributes attributes = new ImageAttributes();
|
||||
|
@ -1241,12 +1241,12 @@ public static Image CreateGrayscale(Image sourceImage)
|
|||
{
|
||||
Bitmap clone = (Bitmap)Clone(sourceImage);
|
||||
ColorMatrix grayscaleMatrix = new ColorMatrix(new float[][] {
|
||||
new float[] {.3f, .3f, .3f, 0, 0},
|
||||
new float[] {.59f, .59f, .59f, 0, 0},
|
||||
new float[] {.11f, .11f, .11f, 0, 0},
|
||||
new float[] {0, 0, 0, 1, 0},
|
||||
new float[] {0, 0, 0, 0, 1}
|
||||
});
|
||||
new float[] {.3f, .3f, .3f, 0, 0},
|
||||
new float[] {.59f, .59f, .59f, 0, 0},
|
||||
new float[] {.11f, .11f, .11f, 0, 0},
|
||||
new float[] {0, 0, 0, 1, 0},
|
||||
new float[] {0, 0, 0, 0, 1}
|
||||
});
|
||||
ApplyColorMatrix(clone, grayscaleMatrix);
|
||||
return clone;
|
||||
}
|
||||
|
|
|
@ -90,11 +90,11 @@ public class WuQuantizer : IDisposable
|
|||
private Int32[] blues;
|
||||
private Int32[] sums;
|
||||
|
||||
private Int64[, ,] weights;
|
||||
private Int64[, ,] momentsRed;
|
||||
private Int64[, ,] momentsGreen;
|
||||
private Int64[, ,] momentsBlue;
|
||||
private Single[, ,] moments;
|
||||
private Int64[,,] weights;
|
||||
private Int64[,,] momentsRed;
|
||||
private Int64[,,] momentsGreen;
|
||||
private Int64[,,] momentsBlue;
|
||||
private Single[,,] moments;
|
||||
|
||||
private byte[] tag;
|
||||
|
||||
|
@ -526,7 +526,7 @@ private void CalculateMoments()
|
|||
/// <summary>
|
||||
/// Computes the volume of the cube in a specific moment.
|
||||
/// </summary>
|
||||
private static Int64 Volume(WuColorCube cube, Int64[, ,] moment)
|
||||
private static Int64 Volume(WuColorCube cube, Int64[,,] moment)
|
||||
{
|
||||
return moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMaximum] -
|
||||
moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMinimum] -
|
||||
|
@ -541,7 +541,7 @@ private static Int64 Volume(WuColorCube cube, Int64[, ,] moment)
|
|||
/// <summary>
|
||||
/// Computes the volume of the cube in a specific moment. For the floating-point values.
|
||||
/// </summary>
|
||||
private static Single VolumeFloat(WuColorCube cube, Single[, ,] moment)
|
||||
private static Single VolumeFloat(WuColorCube cube, Single[,,] moment)
|
||||
{
|
||||
return moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMaximum] -
|
||||
moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMinimum] -
|
||||
|
@ -556,7 +556,7 @@ private static Single VolumeFloat(WuColorCube cube, Single[, ,] moment)
|
|||
/// <summary>
|
||||
/// Splits the cube in given position, and color direction.
|
||||
/// </summary>
|
||||
private static Int64 Top(WuColorCube cube, Int32 direction, Int32 position, Int64[, ,] moment)
|
||||
private static Int64 Top(WuColorCube cube, Int32 direction, Int32 position, Int64[,,] moment)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
|
@ -586,7 +586,7 @@ private static Int64 Top(WuColorCube cube, Int32 direction, Int32 position, Int6
|
|||
/// <summary>
|
||||
/// Splits the cube in a given color direction at its minimum.
|
||||
/// </summary>
|
||||
private static Int64 Bottom(WuColorCube cube, Int32 direction, Int64[, ,] moment)
|
||||
private static Int64 Bottom(WuColorCube cube, Int32 direction, Int64[,,] moment)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
|
|
|
@ -52,27 +52,27 @@ public class FieldType
|
|||
public static readonly FieldType FLAGS = new FieldType("FLAGS");
|
||||
|
||||
public static FieldType[] Values = new FieldType[]{
|
||||
ARROWHEADS,
|
||||
BLUR_RADIUS,
|
||||
BRIGHTNESS,
|
||||
FILL_COLOR,
|
||||
FONT_BOLD,
|
||||
FONT_FAMILY,
|
||||
FONT_ITALIC,
|
||||
FONT_SIZE,
|
||||
TEXT_HORIZONTAL_ALIGNMENT,
|
||||
TEXT_VERTICAL_ALIGNMENT,
|
||||
HIGHLIGHT_COLOR,
|
||||
LINE_COLOR,
|
||||
LINE_THICKNESS,
|
||||
MAGNIFICATION_FACTOR,
|
||||
PIXEL_SIZE,
|
||||
PREVIEW_QUALITY,
|
||||
SHADOW,
|
||||
PREPARED_FILTER_OBFUSCATE,
|
||||
PREPARED_FILTER_HIGHLIGHT,
|
||||
FLAGS
|
||||
};
|
||||
ARROWHEADS,
|
||||
BLUR_RADIUS,
|
||||
BRIGHTNESS,
|
||||
FILL_COLOR,
|
||||
FONT_BOLD,
|
||||
FONT_FAMILY,
|
||||
FONT_ITALIC,
|
||||
FONT_SIZE,
|
||||
TEXT_HORIZONTAL_ALIGNMENT,
|
||||
TEXT_VERTICAL_ALIGNMENT,
|
||||
HIGHLIGHT_COLOR,
|
||||
LINE_COLOR,
|
||||
LINE_THICKNESS,
|
||||
MAGNIFICATION_FACTOR,
|
||||
PIXEL_SIZE,
|
||||
PREVIEW_QUALITY,
|
||||
SHADOW,
|
||||
PREPARED_FILTER_OBFUSCATE,
|
||||
PREPARED_FILTER_HIGHLIGHT,
|
||||
FLAGS
|
||||
};
|
||||
|
||||
[Flags]
|
||||
public enum Flag
|
||||
|
|
|
@ -55,12 +55,12 @@ public override void Apply(Graphics graphics, Bitmap applyBitmap, Rectangle rect
|
|||
graphics.ExcludeClip(rect);
|
||||
}
|
||||
ColorMatrix grayscaleMatrix = new ColorMatrix(new float[][] {
|
||||
new float[] {.3f, .3f, .3f, 0, 0},
|
||||
new float[] {.59f, .59f, .59f, 0, 0},
|
||||
new float[] {.11f, .11f, .11f, 0, 0},
|
||||
new float[] {0, 0, 0, 1, 0},
|
||||
new float[] {0, 0, 0, 0, 1}
|
||||
});
|
||||
new float[] {.3f, .3f, .3f, 0, 0},
|
||||
new float[] {.59f, .59f, .59f, 0, 0},
|
||||
new float[] {.11f, .11f, .11f, 0, 0},
|
||||
new float[] {0, 0, 0, 1, 0},
|
||||
new float[] {0, 0, 0, 0, 1}
|
||||
});
|
||||
using (ImageAttributes ia = new ImageAttributes())
|
||||
{
|
||||
ia.SetColorMatrix(grayscaleMatrix);
|
||||
|
|
|
@ -700,7 +700,7 @@ public void LoadElementsFromStream(Stream streamRead)
|
|||
DrawableContainerList loadedElements = (DrawableContainerList)binaryRead.Deserialize(streamRead);
|
||||
loadedElements.Parent = this;
|
||||
// Make sure the steplabels are sorted accoring to their number
|
||||
_stepLabels.Sort(delegate(StepLabelContainer p1, StepLabelContainer p2)
|
||||
_stepLabels.Sort(delegate (StepLabelContainer p1, StepLabelContainer p2)
|
||||
{
|
||||
return p1.Number.CompareTo(p2.Number);
|
||||
});
|
||||
|
|
|
@ -24,9 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -117,7 +117,7 @@ public void PrintPage(PrintPageEventArgs e)
|
|||
// next character
|
||||
int c;
|
||||
|
||||
for (; ; )
|
||||
for (;;)
|
||||
{
|
||||
// get next character
|
||||
c = NextChar();
|
||||
|
|
|
@ -223,10 +223,10 @@ private void UpdateItemCount(HistoryItem[] historyItems)
|
|||
|
||||
var types = from hi in historyItems
|
||||
group hi by hi.Type
|
||||
into t
|
||||
let count = t.Count()
|
||||
orderby t.Key
|
||||
select string.Format(", {0}: {1}", t.Key, count);
|
||||
into t
|
||||
let count = t.Count()
|
||||
orderby t.Key
|
||||
select string.Format(", {0}: {1}", t.Key, count);
|
||||
|
||||
foreach (string type in types)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,6 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using ShareX.ScreenCaptureLib.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Text;
|
||||
|
|
|
@ -24,11 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX.ScreenCaptureLib
|
||||
{
|
||||
|
|
|
@ -25,11 +25,7 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX.ScreenCaptureLib
|
||||
|
|
|
@ -24,11 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX.UploadersLib.FileUploaders
|
||||
{
|
||||
|
|
|
@ -23,11 +23,6 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX.UploadersLib.FileUploaders
|
||||
{
|
||||
public sealed class MaxFile : Pomf
|
||||
|
|
|
@ -30,7 +30,6 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
|
|
|
@ -2149,7 +2149,8 @@ private void txtLnkUAPIKEY_TextChanged(object sender, EventArgs e)
|
|||
{
|
||||
Config.LnkUAPIKEY = txtLnkUAPIKEY.Text;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion LnkU.co
|
||||
|
||||
#region CoinURL
|
||||
|
||||
|
@ -2157,7 +2158,8 @@ private void txtCoinURLUUID_TextChanged(object sender, EventArgs e)
|
|||
{
|
||||
Config.CoinURLUUID = txtCoinURLUUID.Text;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion CoinURL
|
||||
|
||||
#endregion URL Shorteners
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace ShareX.UploadersLib.URLShorteners
|
|||
public sealed class QRnetURLShortener : URLShortener
|
||||
{
|
||||
private const string API_ENDPOINT = "http://qr.net/api/short";
|
||||
|
||||
public override UploadResult ShortenURL(string url)
|
||||
{
|
||||
UploadResult result = new UploadResult { URL = url };
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShareX", "ShareX\ShareX.csproj", "{C5AE4585-E9EC-4FA3-B75A-E1210635ACB6}"
|
||||
EndProject
|
||||
|
|
|
@ -26,12 +26,7 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using ShareX.ScreenCaptureLib;
|
||||
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
|
||||
|
|
|
@ -25,7 +25,6 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
using ShareX.HelpersLib;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ShareX
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue