Automated dotnet-format update
This commit is contained in:
1 parent
ad4c2f68aa
commit
2af18c2d38
403 files changed
+1569
-1567
No files matched your search
@@ -21,6 +21,6 @@ namespace HandyControl.Controls
|
||||
{
|
||||
get => GetValue(SourceContentProperty);
|
||||
set => SetValue(SourceContentProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,4 +114,4 @@ namespace HandyControl.Controls
|
||||
componentLength = trackLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ namespace HandyControl.Controls
|
||||
if (_thumb.IsMouseCaptureWithin)
|
||||
{
|
||||
PreviewPosition = Value;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,4 +192,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace HandyControl.Controls
|
||||
[TemplatePart(Name = ElementTrack, Type = typeof(Track))]
|
||||
public class RangeSlider : TwoWayRangeBase
|
||||
{
|
||||
private const string ElementTrack= "PART_Track";
|
||||
private const string ElementTrack = "PART_Track";
|
||||
|
||||
private RangeTrack _track;
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
get => (Orientation)GetValue(OrientationProperty);
|
||||
get => (Orientation) GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsDirectionReversed
|
||||
{
|
||||
get => (bool)GetValue(IsDirectionReversedProperty);
|
||||
get => (bool) GetValue(IsDirectionReversedProperty);
|
||||
set => SetValue(IsDirectionReversedProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int Delay
|
||||
{
|
||||
get => (int)GetValue(DelayProperty);
|
||||
get => (int) GetValue(DelayProperty);
|
||||
set => SetValue(DelayProperty, value);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int Interval
|
||||
{
|
||||
get => (int)GetValue(IntervalProperty);
|
||||
get => (int) GetValue(IntervalProperty);
|
||||
set => SetValue(IntervalProperty, value);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public AutoToolTipPlacement AutoToolTipPlacement
|
||||
{
|
||||
get => (AutoToolTipPlacement)GetValue(AutoToolTipPlacementProperty);
|
||||
get => (AutoToolTipPlacement) GetValue(AutoToolTipPlacementProperty);
|
||||
set => SetValue(AutoToolTipPlacementProperty, value);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int AutoToolTipPrecision
|
||||
{
|
||||
get => (int)GetValue(AutoToolTipPrecisionProperty);
|
||||
get => (int) GetValue(AutoToolTipPrecisionProperty);
|
||||
set => SetValue(AutoToolTipPrecisionProperty, value);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsSnapToTickEnabled
|
||||
{
|
||||
get => (bool)GetValue(IsSnapToTickEnabledProperty);
|
||||
get => (bool) GetValue(IsSnapToTickEnabledProperty);
|
||||
set => SetValue(IsSnapToTickEnabledProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public TickPlacement TickPlacement
|
||||
{
|
||||
get => (TickPlacement)GetValue(TickPlacementProperty);
|
||||
get => (TickPlacement) GetValue(TickPlacementProperty);
|
||||
set => SetValue(TickPlacementProperty, value);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double TickFrequency
|
||||
{
|
||||
get => (double)GetValue(TickFrequencyProperty);
|
||||
get => (double) GetValue(TickFrequencyProperty);
|
||||
set => SetValue(TickFrequencyProperty, value);
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DoubleCollection Ticks
|
||||
{
|
||||
get => (DoubleCollection)GetValue(TicksProperty);
|
||||
get => (DoubleCollection) GetValue(TicksProperty);
|
||||
set => SetValue(TicksProperty, value);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsMoveToPointEnabled
|
||||
{
|
||||
get => (bool)GetValue(IsMoveToPointEnabledProperty);
|
||||
get => (bool) GetValue(IsMoveToPointEnabledProperty);
|
||||
set => SetValue(IsMoveToPointEnabledProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace HandyControl.Controls
|
||||
var greaterThan = direction > 0;
|
||||
|
||||
// If the snapping brought us back to value, find the next tick point
|
||||
if (MathHelper.AreClose(next, value) &&
|
||||
if (MathHelper.AreClose(next, value) &&
|
||||
!(greaterThan && MathHelper.AreClose(value, Maximum)) &&
|
||||
!(!greaterThan && MathHelper.AreClose(value, Minimum)))
|
||||
{
|
||||
@@ -522,7 +522,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private string GetAutoToolTipNumber(bool isStart)
|
||||
{
|
||||
var format = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
|
||||
var format = (NumberFormatInfo) NumberFormatInfo.CurrentInfo.Clone();
|
||||
format.NumberDecimalDigits = AutoToolTipPrecision;
|
||||
return isStart ? ValueStart.ToString("N", format) : ValueEnd.ToString("N", format);
|
||||
}
|
||||
@@ -603,7 +603,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (e.ChangedButton != MouseButton.Left) return;
|
||||
|
||||
var slider = (RangeSlider)sender;
|
||||
var slider = (RangeSlider) sender;
|
||||
|
||||
// When someone click on the Slider's part, and it's not focusable
|
||||
// Slider need to take the focus in order to process keyboard correctly
|
||||
@@ -648,4 +648,4 @@ namespace HandyControl.Controls
|
||||
_thumbCurrent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace HandyControl.Controls
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void StartDrag()
|
||||
@@ -43,4 +43,4 @@ namespace HandyControl.Controls
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register(
|
||||
"ValueEnd", typeof(double), typeof(RangeTrack),
|
||||
"ValueEnd", typeof(double), typeof(RangeTrack),
|
||||
new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
|
||||
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
|
||||
FrameworkPropertyMetadataOptions.AffectsArrange));
|
||||
@@ -310,7 +310,7 @@ namespace HandyControl.Controls
|
||||
out double thumbEndLength)
|
||||
{
|
||||
var min = Minimum;
|
||||
var range = Math.Max(0.0, Maximum - min);
|
||||
var range = Math.Max(0.0, Maximum - min);
|
||||
var offsetStart = Math.Min(range, ValueStart - min);
|
||||
var offsetEnd = Math.Min(range, ValueEnd - min);
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
Mouse.Synchronize();
|
||||
}
|
||||
@@ -441,4 +441,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
// Adapted from https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Controls/Primitives/RangeBase.cs
|
||||
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -15,12 +15,12 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctrl = (TwoWayRangeBase)d;
|
||||
var ctrl = (TwoWayRangeBase) d;
|
||||
|
||||
ctrl.CoerceValue(MaximumProperty);
|
||||
ctrl.CoerceValue(ValueStartProperty);
|
||||
ctrl.CoerceValue(ValueEndProperty);
|
||||
ctrl.OnMinimumChanged((double)e.OldValue, (double)e.NewValue);
|
||||
ctrl.OnMinimumChanged((double) e.OldValue, (double) e.NewValue);
|
||||
}
|
||||
|
||||
protected virtual void OnMinimumChanged(double oldMinimum, double newMinimum)
|
||||
@@ -29,7 +29,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double Minimum
|
||||
{
|
||||
get => (double)GetValue(MinimumProperty);
|
||||
get => (double) GetValue(MinimumProperty);
|
||||
set => SetValue(MinimumProperty, value);
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoerceMaximum(DependencyObject d, object basevalue)
|
||||
{
|
||||
var ctrl = (TwoWayRangeBase)d;
|
||||
var ctrl = (TwoWayRangeBase) d;
|
||||
var min = ctrl.Minimum;
|
||||
if ((double)basevalue < min)
|
||||
if ((double) basevalue < min)
|
||||
{
|
||||
return min;
|
||||
}
|
||||
@@ -51,11 +51,11 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctrl = (TwoWayRangeBase)d;
|
||||
var ctrl = (TwoWayRangeBase) d;
|
||||
|
||||
ctrl.CoerceValue(ValueStartProperty);
|
||||
ctrl.CoerceValue(ValueEndProperty);
|
||||
ctrl.OnMaximumChanged((double)e.OldValue, (double)e.NewValue);
|
||||
ctrl.OnMaximumChanged((double) e.OldValue, (double) e.NewValue);
|
||||
}
|
||||
|
||||
protected virtual void OnMaximumChanged(double oldMaximum, double newMaximum)
|
||||
@@ -64,7 +64,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double Maximum
|
||||
{
|
||||
get => (double)GetValue(MaximumProperty);
|
||||
get => (double) GetValue(MaximumProperty);
|
||||
set => SetValue(MaximumProperty, value);
|
||||
}
|
||||
|
||||
@@ -76,24 +76,24 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnValueStartChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctrl = (TwoWayRangeBase)d;
|
||||
var ctrl = (TwoWayRangeBase) d;
|
||||
ctrl.OnValueChanged(new DoubleRange
|
||||
{
|
||||
Start = (double)e.OldValue,
|
||||
Start = (double) e.OldValue,
|
||||
End = ctrl.ValueEnd
|
||||
}, new DoubleRange
|
||||
{
|
||||
Start = (double)e.NewValue,
|
||||
Start = (double) e.NewValue,
|
||||
End = ctrl.ValueEnd
|
||||
});
|
||||
}
|
||||
|
||||
protected virtual void OnValueChanged(DoubleRange oldValue, DoubleRange newValue) => RaiseEvent(
|
||||
new RoutedPropertyChangedEventArgs<DoubleRange>(oldValue, newValue) {RoutedEvent = ValueChangedEvent});
|
||||
new RoutedPropertyChangedEventArgs<DoubleRange>(oldValue, newValue) { RoutedEvent = ValueChangedEvent });
|
||||
|
||||
public double ValueStart
|
||||
{
|
||||
get => (double)GetValue(ValueStartProperty);
|
||||
get => (double) GetValue(ValueStartProperty);
|
||||
set => SetValue(ValueStartProperty, value);
|
||||
}
|
||||
|
||||
@@ -105,29 +105,29 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnValueEndChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctrl = (TwoWayRangeBase)d;
|
||||
var ctrl = (TwoWayRangeBase) d;
|
||||
ctrl.OnValueChanged(new DoubleRange
|
||||
{
|
||||
Start = ctrl.ValueStart,
|
||||
End = (double)e.OldValue
|
||||
End = (double) e.OldValue
|
||||
}, new DoubleRange
|
||||
{
|
||||
Start = ctrl.ValueStart,
|
||||
End = (double)e.NewValue
|
||||
End = (double) e.NewValue
|
||||
});
|
||||
}
|
||||
|
||||
public double ValueEnd
|
||||
{
|
||||
get => (double)GetValue(ValueEndProperty);
|
||||
get => (double) GetValue(ValueEndProperty);
|
||||
set => SetValue(ValueEndProperty, value);
|
||||
}
|
||||
|
||||
internal static object ConstrainToRange(DependencyObject d, object value)
|
||||
{
|
||||
var ctrl = (TwoWayRangeBase)d;
|
||||
var ctrl = (TwoWayRangeBase) d;
|
||||
var min = ctrl.Minimum;
|
||||
var v = (double)value;
|
||||
var v = (double) value;
|
||||
if (v < min)
|
||||
{
|
||||
return min;
|
||||
@@ -148,7 +148,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double LargeChange
|
||||
{
|
||||
get => (double)GetValue(LargeChangeProperty);
|
||||
get => (double) GetValue(LargeChangeProperty);
|
||||
set => SetValue(LargeChangeProperty, value);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SmallChange
|
||||
{
|
||||
get => (double)GetValue(SmallChangeProperty);
|
||||
get => (double) GetValue(SmallChangeProperty);
|
||||
set => SetValue(SmallChangeProperty, value);
|
||||
}
|
||||
|
||||
@@ -171,4 +171,4 @@ namespace HandyControl.Controls
|
||||
remove => RemoveHandler(ValueChangedEvent, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user