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

@@ -58,7 +58,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsAnimationEnabled
{
get => (bool)GetValue(IsAnimationEnabledProperty);
get => (bool) GetValue(IsAnimationEnabledProperty);
set => SetValue(IsAnimationEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -73,7 +73,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsDraggable
{
get => (bool)GetValue(IsDraggableProperty);
get => (bool) GetValue(IsDraggableProperty);
set => SetValue(IsDraggableProperty, ValueBoxes.BooleanBox(value));
}
@@ -94,7 +94,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowCloseButton
{
get => (bool)GetValue(ShowCloseButtonProperty);
get => (bool) GetValue(ShowCloseButtonProperty);
set => SetValue(ShowCloseButtonProperty, value);
}
@@ -115,7 +115,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowContextMenu
{
get => (bool)GetValue(ShowContextMenuProperty);
get => (bool) GetValue(ShowContextMenuProperty);
set => SetValue(ShowContextMenuProperty, value);
}
@@ -130,7 +130,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsTabFillEnabled
{
get => (bool)GetValue(IsTabFillEnabledProperty);
get => (bool) GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemWidth
{
get => (double)GetValue(TabItemWidthProperty);
get => (double) GetValue(TabItemWidthProperty);
set => SetValue(TabItemWidthProperty, value);
}
@@ -160,7 +160,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemHeight
{
get => (double)GetValue(TabItemHeightProperty);
get => (double) GetValue(TabItemHeightProperty);
set => SetValue(TabItemHeightProperty, value);
}
@@ -299,7 +299,7 @@ namespace HandyControl.Controls
{
if (!IsTabFillEnabled)
{
_itemShowCount = (int)(ActualWidth / TabItemWidth);
_itemShowCount = (int) (ActualWidth / TabItemWidth);
_buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
}
}
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
_buttonOverflow.Menu.Items.Clear();
for (var i = 0; i < Items.Count; i++)
{
if(!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue;
if (!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue;
var menuItem = new MenuItem
{
@@ -429,4 +429,4 @@ namespace HandyControl.Controls
protected override DependencyObject GetContainerForItemOverride() => new TabItem();
}
}
}
@@ -140,7 +140,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowCloseButton
{
get => (bool)GetValue(ShowCloseButtonProperty);
get => (bool) GetValue(ShowCloseButtonProperty);
set => SetValue(ShowCloseButtonProperty, value);
}
@@ -148,7 +148,7 @@ namespace HandyControl.Controls
=> element.SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value));
public static bool GetShowCloseButton(DependencyObject element)
=> (bool)element.GetValue(ShowCloseButtonProperty);
=> (bool) element.GetValue(ShowCloseButtonProperty);
/// <summary>
/// 是否显示上下文菜单
@@ -161,7 +161,7 @@ namespace HandyControl.Controls
var ctl = (TabItem) d;
if (ctl.Menu != null)
{
var show = (bool)e.NewValue;
var show = (bool) e.NewValue;
ctl.Menu.IsEnabled = show;
ctl.Menu.Show(show);
}
@@ -180,7 +180,7 @@ namespace HandyControl.Controls
=> element.SetValue(ShowContextMenuProperty, ValueBoxes.BooleanBox(value));
public static bool GetShowContextMenu(DependencyObject element)
=> (bool)element.GetValue(ShowContextMenuProperty);
=> (bool) element.GetValue(ShowContextMenuProperty);
public static readonly DependencyProperty MenuProperty = DependencyProperty.Register(
"Menu", typeof(ContextMenu), typeof(TabItem), new PropertyMetadata(default(ContextMenu), OnMenuChanged));
@@ -283,7 +283,7 @@ namespace HandyControl.Controls
TabPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, parent.IsAnimationEnabled
? new Duration(TimeSpan.FromMilliseconds(200))
: new Duration(TimeSpan.FromMilliseconds(1)));
parent.IsInternalAction = true;
RaiseEvent(new RoutedEventArgs(ClosedEvent, item));
@@ -332,18 +332,18 @@ namespace HandyControl.Controls
var subX = TranslatePoint(new Point(), parent).X + _scrollHorizontalOffset;
CurrentIndex = CalLocationIndex(subX);
var p = e.GetPosition(parent);
p = new Point(p.X + _scrollHorizontalOffset, p.Y);
var subLeft = p.X - _dragPoint.X;
var totalLeft = p.X - _mouseDownPoint.X;
if (Math.Abs(subLeft) <= WaitLength && _isWaiting) return;
_isWaiting = false;
_isDragged = true;
var left = subLeft + RenderTransform.Value.OffsetX;
if (totalLeft < _maxMoveLeft)
{
@@ -353,7 +353,7 @@ namespace HandyControl.Controls
{
left = _maxMoveRight + _mouseDownOffsetX;
}
var t = new TranslateTransform(left, 0);
RenderTransform = t;
_dragPoint = p;
@@ -363,9 +363,9 @@ namespace HandyControl.Controls
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonUp(e);
ReleaseMouseCapture();
if (_isDragged)
{
var parent = TabControlParent;
@@ -377,7 +377,7 @@ namespace HandyControl.Controls
var offsetX = RenderTransform.Value.OffsetX;
CreateAnimation(offsetX, offsetX - subX + left, index);
}
_isDragging = false;
ItemIsDragging = false;
_isDragged = false;
@@ -412,7 +412,7 @@ namespace HandyControl.Controls
TabPanel.ForceUpdate = true;
TabPanel.Measure(new Size(TabPanel.DesiredSize.Width, ActualHeight));
TabPanel.ForceUpdate = false;
Focus();
IsSelected = true;
@@ -447,10 +447,10 @@ namespace HandyControl.Controls
if (_isWaiting)
{
return CurrentIndex;
}
}
var maxIndex = TabControlParent.Items.Count - 1;
var div = (int)(left / ItemWidth);
var div = (int) (left / ItemWidth);
var rest = left % ItemWidth;
var result = rest / ItemWidth > .5 ? div + 1 : div;
@@ -473,4 +473,4 @@ namespace HandyControl.Controls
remove => RemoveHandler(ClosedEvent, value);
}
}
}
}
@@ -37,7 +37,7 @@ namespace HandyControl.Controls
/// </summary>
public Duration FluidMoveDuration
{
get => (Duration)GetValue(FluidMoveDurationProperty);
get => (Duration) GetValue(FluidMoveDurationProperty);
set => SetValue(FluidMoveDurationProperty, value);
}
@@ -52,7 +52,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsTabFillEnabled
{
get => (bool)GetValue(IsTabFillEnabledProperty);
get => (bool) GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -67,7 +67,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemWidth
{
get => (double)GetValue(TabItemWidthProperty);
get => (double) GetValue(TabItemWidthProperty);
set => SetValue(TabItemWidthProperty, value);
}
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemHeight
{
get => (double)GetValue(TabItemHeightProperty);
get => (double) GetValue(TabItemHeightProperty);
set => SetValue(TabItemHeightProperty, value);
}
@@ -127,7 +127,7 @@ namespace HandyControl.Controls
{
if (TemplatedParent is TabControl tabControl)
{
arr = ArithmeticHelper.DivideInt2Arr((int)tabControl.ActualWidth + InternalChildren.Count, count);
arr = ArithmeticHelper.DivideInt2Arr((int) tabControl.ActualWidth + InternalChildren.Count, count);
}
}
@@ -176,4 +176,4 @@ namespace HandyControl.Controls
};
}
}
}
}