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

@@ -10,13 +10,13 @@ namespace HandyControl.Controls
public static void SetMouseHoverBackground(DependencyObject element, Brush value) => element.SetValue(MouseHoverBackgroundProperty, value);
public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush)element.GetValue(MouseHoverBackgroundProperty);
public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush) element.GetValue(MouseHoverBackgroundProperty);
public static readonly DependencyProperty MouseDownBackgroundProperty = DependencyProperty.RegisterAttached(
"MouseDownBackground", typeof(Brush), typeof(BackgroundSwitchElement), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.Inherits));
public static void SetMouseDownBackground(DependencyObject element, Brush value) => element.SetValue(MouseDownBackgroundProperty, value);
public static Brush GetMouseDownBackground(DependencyObject element) => (Brush)element.GetValue(MouseDownBackgroundProperty);
public static Brush GetMouseDownBackground(DependencyObject element) => (Brush) element.GetValue(MouseDownBackgroundProperty);
}
}
}
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
public static void SetCornerRadius(DependencyObject element, CornerRadius value) => element.SetValue(CornerRadiusProperty, value);
public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius)element.GetValue(CornerRadiusProperty);
public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius) element.GetValue(CornerRadiusProperty);
public static readonly DependencyProperty CircularProperty = DependencyProperty.RegisterAttached(
"Circular", typeof(bool), typeof(BorderElement), new PropertyMetadata(ValueBoxes.FalseBox, OnCircularChanged));
@@ -22,13 +22,13 @@ namespace HandyControl.Controls
{
if (d is Border border)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
var binding = new MultiBinding
{
Converter = new BorderCircularConverter()
};
binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) {Source = border});
binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) { Source = border });
binding.Bindings.Add(new Binding(FrameworkElement.ActualHeightProperty.Name) { Source = border });
border.SetBinding(Border.CornerRadiusProperty, binding);
}
@@ -47,4 +47,4 @@ namespace HandyControl.Controls
public static bool GetCircular(DependencyObject element)
=> (bool) element.GetValue(CircularProperty);
}
}
}
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
@@ -14,8 +14,8 @@ namespace HandyControl.Controls
private static void OnApplyDefaultStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = (DataGrid)d;
if ((bool)e.NewValue)
var grid = (DataGrid) d;
if ((bool) e.NewValue)
{
if (grid.AutoGenerateColumns)
{
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
private static void Grid_AutoGeneratedColumns(object sender, System.EventArgs e)
{
var grid = (DataGrid)sender;
var grid = (DataGrid) sender;
UpdateTextColumnStyles(grid);
UpdateComboBoxColumnStyles(grid);
UpdateCheckBoxColumnStyles(grid);
@@ -52,7 +52,7 @@ namespace HandyControl.Controls
private static void OnTextColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = (DataGrid)d;
var grid = (DataGrid) d;
if (e.OldValue == null && e.NewValue != null)
{
UpdateTextColumnStyles(grid);
@@ -61,7 +61,7 @@ namespace HandyControl.Controls
public static void SetTextColumnStyle(DependencyObject element, Style value) => element.SetValue(TextColumnStyleProperty, value);
public static Style GetTextColumnStyle(DependencyObject element) => (Style)element.GetValue(TextColumnStyleProperty);
public static Style GetTextColumnStyle(DependencyObject element) => (Style) element.GetValue(TextColumnStyleProperty);
public static readonly DependencyProperty EditingTextColumnStyleProperty = DependencyProperty.RegisterAttached(
"EditingTextColumnStyle", typeof(Style), typeof(DataGridAttach), new PropertyMetadata(default(Style), OnTextColumnStyleChanged));
@@ -119,7 +119,7 @@ namespace HandyControl.Controls
private static void OnComboBoxColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = (DataGrid)d;
var grid = (DataGrid) d;
if (e.OldValue == null && e.NewValue != null)
{
UpdateComboBoxColumnStyles(grid);
@@ -186,7 +186,7 @@ namespace HandyControl.Controls
private static void OnCheckBoxColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = (DataGrid)d;
var grid = (DataGrid) d;
if (e.OldValue == null && e.NewValue != null)
{
UpdateCheckBoxColumnStyles(grid);
@@ -195,7 +195,7 @@ namespace HandyControl.Controls
public static void SetCheckBoxColumnStyle(DependencyObject element, Style value) => element.SetValue(CheckBoxColumnStyleProperty, value);
public static Style GetCheckBoxColumnStyle(DependencyObject element) => (Style)element.GetValue(CheckBoxColumnStyleProperty);
public static Style GetCheckBoxColumnStyle(DependencyObject element) => (Style) element.GetValue(CheckBoxColumnStyleProperty);
public static readonly DependencyProperty EditingCheckBoxColumnStyleProperty = DependencyProperty.RegisterAttached(
"EditingCheckBoxColumnStyle", typeof(Style), typeof(DataGridAttach), new PropertyMetadata(default(Style), OnCheckBoxColumnStyleChanged));
@@ -252,14 +252,14 @@ namespace HandyControl.Controls
typeof(bool), typeof(DataGridAttach),
new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnShowRowNumberChanged));
public static bool GetShowRowNumber(DependencyObject target) => (bool)target.GetValue(ShowRowNumberProperty);
public static bool GetShowRowNumber(DependencyObject target) => (bool) target.GetValue(ShowRowNumberProperty);
public static void SetShowRowNumber(DependencyObject target, bool value) => target.SetValue(ShowRowNumberProperty, ValueBoxes.BooleanBox(value));
private static void OnShowRowNumberChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
{
if (!(target is DataGrid dataGrid)) return;
var show = (bool)e.NewValue;
var show = (bool) e.NewValue;
if (show)
{
@@ -287,7 +287,7 @@ namespace HandyControl.Controls
{
for (var i = 0; i < itemsCount; i++)
{
var row = (DataGridRow)generator.ContainerFromIndex(i);
var row = (DataGridRow) generator.ContainerFromIndex(i);
if (row != null)
{
row.Header = (i + 1).ToString();
@@ -298,7 +298,7 @@ namespace HandyControl.Controls
{
for (var i = 0; i < itemsCount; i++)
{
var row = (DataGridRow)generator.ContainerFromIndex(i);
var row = (DataGridRow) generator.ContainerFromIndex(i);
if (row != null)
{
row.Header = null;
@@ -316,7 +316,7 @@ namespace HandyControl.Controls
{
if (d is DataGrid dataGrid)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
dataGrid.PreviewMouseDown += DataGrid_PreviewMouseDown;
}
@@ -44,4 +44,4 @@ namespace HandyControl.Controls
SetShowEdgeContent(d, !(GetLeftContent(d) == null && GetTopContent(d) == null &&
GetRightContent(d) == null && GetBottomContent(d) == null));
}
}
}
@@ -11,7 +11,7 @@ namespace HandyControl.Controls
public static void SetGeometry(DependencyObject element, Geometry value)
=> element.SetValue(GeometryProperty, value);
public static Geometry GetGeometry(DependencyObject element)
public static Geometry GetGeometry(DependencyObject element)
=> (Geometry) element.GetValue(GeometryProperty);
public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
@@ -32,4 +32,4 @@ namespace HandyControl.Controls
public static double GetHeight(DependencyObject element)
=> (double) element.GetValue(HeightProperty);
}
}
}
@@ -15,7 +15,7 @@ namespace HandyControl.Controls
public static Geometry GetGeometrySelected(DependencyObject element)
{
return (Geometry)element.GetValue(GeometrySelectedProperty);
return (Geometry) element.GetValue(GeometrySelectedProperty);
}
}
}
}
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
public static void SetPlaceholder(DependencyObject element, string value) => element.SetValue(PlaceholderProperty, value);
public static string GetPlaceholder(DependencyObject element) => (string)element.GetValue(PlaceholderProperty);
public static string GetPlaceholder(DependencyObject element) => (string) element.GetValue(PlaceholderProperty);
/// <summary>
/// 是否必填
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
public static void SetNecessary(DependencyObject element, bool value) => element.SetValue(NecessaryProperty, ValueBoxes.BooleanBox(value));
public static bool GetNecessary(DependencyObject element) => (bool)element.GetValue(NecessaryProperty);
public static bool GetNecessary(DependencyObject element) => (bool) element.GetValue(NecessaryProperty);
/// <summary>
/// 标记
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
public static void SetSymbol(DependencyObject element, string value) => element.SetValue(SymbolProperty, value);
public static string GetSymbol(DependencyObject element) => (string)element.GetValue(SymbolProperty);
public static string GetSymbol(DependencyObject element) => (string) element.GetValue(SymbolProperty);
/// <summary>
/// 内容高度
@@ -43,7 +43,7 @@ namespace HandyControl.Controls
public static void SetContentHeight(DependencyObject element, double value) => element.SetValue(ContentHeightProperty, value);
public static double GetContentHeight(DependencyObject element) => (double)element.GetValue(ContentHeightProperty);
public static double GetContentHeight(DependencyObject element) => (double) element.GetValue(ContentHeightProperty);
/// <summary>
/// 最小内容高度
@@ -81,4 +81,4 @@ namespace HandyControl.Controls
public static string GetRegexPattern(DependencyObject element)
=> (string) element.GetValue(RegexPatternProperty);
}
}
}
@@ -28,7 +28,7 @@ namespace HandyControl.Controls
private static void MenuItem_Loaded(object sender, RoutedEventArgs e)
{
var menuItem = (FrameworkElement)sender;
var menuItem = (FrameworkElement) sender;
menuItem.Unloaded += MenuItem_Unloaded;
var topLine = GetTopLine(menuItem);
var popup = GetPopup(topLine);
@@ -40,7 +40,7 @@ namespace HandyControl.Controls
private static void MenuItem_Unloaded(object sender, RoutedEventArgs e)
{
var menuItem = (FrameworkElement)sender;
var menuItem = (FrameworkElement) sender;
menuItem.Unloaded -= MenuItem_Unloaded;
var topLine = GetTopLine(menuItem);
var popup = GetPopup(topLine);
@@ -69,7 +69,7 @@ namespace HandyControl.Controls
if (positionLeftTop.X < 0)
{
topLine.Margin = new Thickness(positionLeftTop.X - panel.Margin.Left, 0, 0, 0);
}
else if (positionLeftTop.X + panel.ActualWidth > workAreaRect.Right)
@@ -12,7 +12,7 @@ namespace HandyControl.Controls
private static void OnFluidMoveBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is Panel panel)
{
{
var collection = Interaction.GetBehaviors(panel);
var oldBehavior = GetTempFluidMoveBehavior(panel);
collection.ItemRemoved(oldBehavior);
@@ -41,4 +41,4 @@ namespace HandyControl.Controls
private static FluidMoveBehavior GetTempFluidMoveBehavior(DependencyObject element)
=> (FluidMoveBehavior) element.GetValue(TempFluidMoveBehaviorProperty);
}
}
}
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
public static void SetPasswordLength(DependencyObject element, int value) => element.SetValue(PasswordLengthProperty, value);
public static int GetPasswordLength(DependencyObject element) => (int)element.GetValue(PasswordLengthProperty);
public static int GetPasswordLength(DependencyObject element) => (int) element.GetValue(PasswordLengthProperty);
/// <summary>
/// 是否监测
@@ -41,7 +41,7 @@ namespace HandyControl.Controls
public static void SetIsMonitoring(DependencyObject element, bool value) => element.SetValue(IsMonitoringProperty, ValueBoxes.BooleanBox(value));
public static bool GetIsMonitoring(DependencyObject element) => (bool)element.GetValue(IsMonitoringProperty);
public static bool GetIsMonitoring(DependencyObject element) => (bool) element.GetValue(IsMonitoringProperty);
private static void PasswordChanged(object sender, RoutedEventArgs e)
{
@@ -51,4 +51,4 @@ namespace HandyControl.Controls
}
}
}
}
}
@@ -15,7 +15,7 @@ namespace HandyControl.Controls
{
if (d is Rectangle rectangle)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
var binding = new MultiBinding
{
@@ -25,4 +25,4 @@ namespace HandyControl.Controls
public static bool GetHideUncheckedElement(DependencyObject element) => (bool) element.GetValue(HideUncheckedElementProperty);
}
}
}
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
{
if (d is TextBlock ctl)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
ctl.TextTrimming = TextTrimming.WordEllipsis;
UpdateTooltip(ctl);
@@ -50,4 +50,4 @@ namespace HandyControl.Controls
textBlock.RenderSize.Width > width || textBlock.ActualWidth < width ? textBlock.Text : null);
}
}
}
}
@@ -28,4 +28,4 @@ namespace HandyControl.Controls
public static string GetStringFormat(DependencyObject element)
=> (string) element.GetValue(StringFormatProperty);
}
}
}
@@ -56,7 +56,7 @@ namespace HandyControl.Controls
public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value);
public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty);
public static GridLength GetTitleWidth(DependencyObject element) => (GridLength) element.GetValue(TitleWidthProperty);
public static readonly DependencyProperty HorizontalAlignmentProperty = DependencyProperty.RegisterAttached(
"HorizontalAlignment", typeof(HorizontalAlignment), typeof(TitleElement), new FrameworkPropertyMetadata(default(HorizontalAlignment), FrameworkPropertyMetadataOptions.Inherits));
@@ -76,4 +76,4 @@ namespace HandyControl.Controls
public static VerticalAlignment GetVerticalAlignment(DependencyObject element)
=> (VerticalAlignment) element.GetValue(VerticalAlignmentProperty);
}
}
}
@@ -50,4 +50,4 @@ namespace HandyControl.Controls
public static string GetText(DependencyObject element)
=> (string) element.GetValue(TextProperty);
}
}
}
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
{
if (d is UIElement ctl)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
ctl.MouseLeftButtonDown += DragElement_MouseLeftButtonDown;
}
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
{
if (d is System.Windows.Window window)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
window.PreviewKeyDown += Window_PreviewKeyDown;
}
@@ -110,7 +110,7 @@ namespace HandyControl.Controls
=> element.SetValue(ShowInTaskManagerProperty, ValueBoxes.BooleanBox(value));
public static bool GetShowInTaskManager(DependencyObject element)
=> (bool)element.GetValue(ShowInTaskManagerProperty);
=> (bool) element.GetValue(ShowInTaskManagerProperty);
public static readonly DependencyProperty HideWhenClosingProperty = DependencyProperty.RegisterAttached(
"HideWhenClosing", typeof(bool), typeof(WindowAttach), new PropertyMetadata(ValueBoxes.FalseBox, OnHideWhenClosingChanged));
@@ -119,7 +119,7 @@ namespace HandyControl.Controls
{
if (d is System.Windows.Window window)
{
var v = (bool)e.NewValue;
var v = (bool) e.NewValue;
if (v)
{
window.Closing += Window_Closing;
@@ -146,4 +146,4 @@ namespace HandyControl.Controls
public static bool GetHideWhenClosing(DependencyObject element)
=> (bool) element.GetValue(HideWhenClosingProperty);
}
}
}