Automated dotnet-format update

This commit is contained in:
github-actions-dotnet-formatter[bot] committed 2020-12-04 15:12:55 +00:00
1 parent ad4c2f68aa
commit 2af18c2d38
403 files changed
+1569 -1567

No files matched your search

@@ -91,4 +91,4 @@ namespace HandyControl.Tools
return accumulated;
}
}
}
}
@@ -136,4 +136,4 @@ namespace HandyControl.Tools
return Vector3D.CrossProduct(v0, v1);
}
}
}
}
@@ -17,4 +17,4 @@ namespace HandyControl.Tools
return Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]);
}
}
}
}
@@ -20,7 +20,7 @@ namespace HandyControl.Tools
}
public static ConfigHelper Instance = new Lazy<ConfigHelper>(() => new ConfigHelper()).Value;
public static ConfigHelper Instance = new Lazy<ConfigHelper>(() => new ConfigHelper()).Value;
private XmlLanguage _lang = XmlLanguage.GetLanguage("zh-cn");
@@ -50,7 +50,7 @@ namespace HandyControl.Tools
SetTimelineFrameRate(config.TimelineFrameRate);
}
public void SetTimelineFrameRate(int rate) =>
public void SetTimelineFrameRate(int rate) =>
Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata(rate));
public void SetWindowDefaultStyle(object resourceKey = null)
@@ -82,7 +82,7 @@ namespace HandyControl.Tools
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
#endif
}
}
@@ -13,10 +13,10 @@ namespace HandyControl.Tools
{
if (!_isInDesignMode.HasValue)
{
_isInDesignMode = (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
_isInDesignMode = (bool) DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
}
return _isInDesignMode.Value;
}
}
}
}
}
@@ -10,7 +10,7 @@ namespace HandyControl.Tools
{
private const double LogicalDpi = 96.0;
[ThreadStatic]
[ThreadStatic]
private static Matrix _transformToDip;
static DpiHelper()
@@ -101,4 +101,4 @@ namespace HandyControl.Tools
return newValue;
}
}
}
}
@@ -37,7 +37,7 @@ namespace HandyControl.Tools
{
bf = GetBestMatch(bf.Decoder.Frames, size);
asGoodAsItGets = bf.Decoder is IconBitmapDecoder || bf.PixelWidth == (int)size.Width && bf.PixelHeight == (int)size.Height;
asGoodAsItGets = bf.Decoder is IconBitmapDecoder || bf.PixelWidth == (int) size.Width && bf.PixelHeight == (int) size.Height;
image = bf;
}
@@ -130,7 +130,7 @@ namespace HandyControl.Tools
var hPos = i % width;
var vPos = i / width;
var byteIndex = hPos / 8;
var offsetBit = (byte)(0x80 >> (hPos % 8));
var offsetBit = (byte) (0x80 >> (hPos % 8));
if (colorArray[i * 4 + 3] == 0x00)
{
@@ -138,7 +138,7 @@ namespace HandyControl.Tools
}
else
{
bitsMask[byteIndex + bytesPerScanLine * vPos] &= (byte)~offsetBit;
bitsMask[byteIndex + bytesPerScanLine * vPos] &= (byte) ~offsetBit;
}
if (hPos == width - 1 && width == 8)
@@ -153,7 +153,7 @@ namespace HandyControl.Tools
internal static int AlignToBytes(double original, int nBytesCount)
{
var nBitsCount = 8 << (nBytesCount - 1);
return ((int)Math.Ceiling(original) + (nBitsCount - 1)) / nBitsCount * nBitsCount;
return ((int) Math.Ceiling(original) + (nBitsCount - 1)) / nBitsCount * nBitsCount;
}
private static BitmapSource GenerateBitmapSource(ImageSource img, Size renderSize)
@@ -183,7 +183,7 @@ namespace HandyControl.Tools
dc.DrawImage(img, drawingDimensions);
dc.Close();
var bmp = new RenderTargetBitmap((int)renderSize.Width, (int)renderSize.Height, 96, 96, PixelFormats.Pbgra32);
var bmp = new RenderTargetBitmap((int) renderSize.Width, (int) renderSize.Height, 96, 96, PixelFormats.Pbgra32);
bmp.Render(dv);
return bmp;
@@ -229,8 +229,8 @@ namespace HandyControl.Tools
private static int MatchImage(BitmapFrame frame, Size size, int bpp)
{
var score = 2 * MyAbs(bpp, SystemBitDepth, false) +
MyAbs(frame.PixelWidth, (int)size.Width, true) +
MyAbs(frame.PixelHeight, (int)size.Height, true);
MyAbs(frame.PixelWidth, (int) size.Width, true) +
MyAbs(frame.PixelHeight, (int) size.Height, true);
return score;
}
@@ -257,7 +257,7 @@ namespace HandyControl.Tools
{
var sysBitDepth = InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.BITSPIXEL);
sysBitDepth *= InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.PLANES);
if (sysBitDepth == 8)
{
sysBitDepth = 4;
@@ -291,4 +291,4 @@ namespace HandyControl.Tools
InteropMethods.ExtractIconEx(iconModuleFile, 0, out largeIconHandle, out smallIconHandle, 1);
}
}
}
}
@@ -14,7 +14,7 @@ namespace HandyControl.Tools
private static void SetInputInfo(DependencyObject element, InputInfo value) => element.SetValue(InputInfoProperty, value);
private static InputInfo GetInputInfo(DependencyObject element) => (InputInfo)element.GetValue(InputInfoProperty);
private static InputInfo GetInputInfo(DependencyObject element) => (InputInfo) element.GetValue(InputInfoProperty);
/// <summary>
/// 将 MouseDown MouseMove MouseUp 封装为点击事件
@@ -67,25 +67,25 @@ namespace HandyControl.Tools
private static void Element_LostMouseCapture(object sender, MouseEventArgs e)
{
var element = (UIElement)sender;
var element = (UIElement) sender;
GetInputInfo(element)?.LostCapture();
}
private static void Element_MouseUp(object sender, MouseButtonEventArgs e)
{
var element = (UIElement)sender;
var element = (UIElement) sender;
GetInputInfo(element)?.Up(e.GetPosition(element));
}
private static void Element_MouseMove(object sender, MouseEventArgs e)
{
var element = (UIElement)sender;
var element = (UIElement) sender;
GetInputInfo(element)?.Move(e.GetPosition(element));
}
private static void Element_MouseDown(object sender, MouseButtonEventArgs e)
{
var element = (UIElement)sender;
var element = (UIElement) sender;
GetInputInfo(element)?.Down(e.GetPosition(element));
}
@@ -146,4 +146,4 @@ namespace HandyControl.Tools
public bool IsEmpty() => ClickEventHandler is null && DragStarted is null;
}
}
}
}
@@ -84,7 +84,7 @@ namespace HandyControl.Tools
{
Source = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{SkinType.Default.ToString()}.xaml")
};
}
}
}
public static Theme GetTheme(string name, ResourceDictionary resourceDictionary)
@@ -94,4 +94,4 @@ namespace HandyControl.Tools
.FirstOrDefault(item => Equals(item.Name, name));
}
}
}
}
@@ -20,7 +20,7 @@ namespace HandyControl.Tools
{
var rects = new List<InteropValues.RECT>();
InteropMethods.EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero,
delegate(IntPtr hMonitor, IntPtr hdcMonitor, ref InteropValues.RECT rect, IntPtr lpData)
delegate (IntPtr hMonitor, IntPtr hdcMonitor, ref InteropValues.RECT rect, IntPtr lpData)
{
var monitorInfo = default(InteropValues.MONITORINFO);
monitorInfo.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO));
@@ -28,9 +28,9 @@ namespace HandyControl.Tools
rects.Add(monitorInfo.rcWork);
return true;
}, IntPtr.Zero);
var num = 0L;
screenSubRect = new InteropValues.RECT
{
Left = 0,
@@ -38,7 +38,7 @@ namespace HandyControl.Tools
Top = 0,
Bottom = 0
};
monitorRect = new InteropValues.RECT
{
Left = 0,
@@ -46,7 +46,7 @@ namespace HandyControl.Tools
Top = 0,
Bottom = 0
};
foreach (var current in rects)
{
var rect = current;
@@ -68,10 +68,10 @@ namespace HandyControl.Tools
X = (int) point.X,
Y = (int) point.Y
}, 2);
monitorRect = new Rect(0.0, 0.0, 0.0, 0.0);
workAreaRect = new Rect(0.0, 0.0, 0.0, 0.0);
if (intPtr != IntPtr.Zero)
{
InteropValues.MONITORINFO monitorInfo = default;
@@ -82,4 +82,4 @@ namespace HandyControl.Tools
}
}
}
}
}
@@ -19,4 +19,4 @@ namespace HandyControl.Tools
_allWindowsUIPermission.Demand();
}
}
}
}
@@ -39,4 +39,4 @@ namespace HandyControl.Tools
return default;
}
}
}
}
@@ -230,4 +230,4 @@ namespace HandyControl.Tools
return numericSeparator;
}
}
}
}
@@ -12,7 +12,7 @@
/// <returns></returns>
public static bool IsInRangeOfDouble(object value)
{
var v = (double)value;
var v = (double) value;
return !(double.IsNaN(v) || double.IsInfinity(v));
}
@@ -23,7 +23,7 @@
/// <returns></returns>
public static bool IsInRangeOfPosDouble(object value)
{
var v = (double)value;
var v = (double) value;
return !(double.IsNaN(v) || double.IsInfinity(v)) && v > 0;
}
@@ -34,7 +34,7 @@
/// <returns></returns>
public static bool IsInRangeOfPosDoubleIncludeZero(object value)
{
var v = (double)value;
var v = (double) value;
return !(double.IsNaN(v) || double.IsInfinity(v)) && v >= 0;
}
@@ -45,7 +45,7 @@
/// <returns></returns>
public static bool IsInRangeOfNegDouble(object value)
{
var v = (double)value;
var v = (double) value;
return !(double.IsNaN(v) || double.IsInfinity(v)) && v < 0;
}
@@ -56,7 +56,7 @@
/// <returns></returns>
public static bool IsInRangeOfNegDoubleIncludeZero(object value)
{
var v = (double)value;
var v = (double) value;
return !(double.IsNaN(v) || double.IsInfinity(v)) && v <= 0;
}
@@ -67,7 +67,7 @@
/// <returns></returns>
public static bool IsInRangeOfPosInt(object value)
{
var v = (int)value;
var v = (int) value;
return v > 0;
}
@@ -78,7 +78,7 @@
/// <returns></returns>
public static bool IsInRangeOfPosIntIncludeZero(object value)
{
var v = (int)value;
var v = (int) value;
return v >= 0;
}
@@ -89,7 +89,7 @@
/// <returns></returns>
public static bool IsInRangeOfNegInt(object value)
{
var v = (int)value;
var v = (int) value;
return v < 0;
}
@@ -100,8 +100,8 @@
/// <returns></returns>
public static bool IsInRangeOfNegIntIncludeZero(object value)
{
var v = (int)value;
var v = (int) value;
return v <= 0;
}
}
}
}
@@ -74,4 +74,4 @@ namespace HandyControl.Tools
return true;
}
}
}
}
@@ -19,7 +19,7 @@ namespace HandyControl.Tools
/// <returns></returns>
public static Window GetActiveWindow() => Application.Current.Windows.OfType<Window>().SingleOrDefault(x => x.IsActive);
private static readonly BitArray _cacheValid = new BitArray((int)InteropValues.CacheSlot.NumSlots);
private static readonly BitArray _cacheValid = new BitArray((int) InteropValues.CacheSlot.NumSlots);
private static bool _setDpiX = true;
@@ -90,7 +90,7 @@ namespace HandyControl.Tools
try
{
_dpiX = InteropMethods.GetDeviceCaps(new HandleRef(null, dc), InteropValues.LOGPIXELSX);
_cacheValid[(int)InteropValues.CacheSlot.DpiX] = true;
_cacheValid[(int) InteropValues.CacheSlot.DpiX] = true;
}
finally
{
@@ -113,9 +113,9 @@ namespace HandyControl.Tools
{
lock (_cacheValid)
{
while (!_cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness])
while (!_cacheValid[(int) InteropValues.CacheSlot.WindowResizeBorderThickness])
{
_cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness] = true;
_cacheValid[(int) InteropValues.CacheSlot.WindowResizeBorderThickness] = true;
var frameSize = new Size(InteropMethods.GetSystemMetrics(InteropValues.SM.CXSIZEFRAME), InteropMethods.GetSystemMetrics(InteropValues.SM.CYSIZEFRAME));
var frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize, DpiX / 96.0, Dpi / 96.0);
@@ -142,7 +142,7 @@ namespace HandyControl.Tools
InteropMethods.ReleaseDC(IntPtr.Zero, hdc);
return WindowResizeBorderThickness.Add(new Thickness((autoHide ? - 4 : 4) * scale));
#else
return WindowResizeBorderThickness.Add(new Thickness(autoHide ? - 4 : 4));
return WindowResizeBorderThickness.Add(new Thickness(autoHide ? -4 : 4));
#endif
}
}