chore: use nameof expression.

This commit is contained in:
NaBian committed 2022-10-10 23:15:48 +08:00
1 parent 3876444176
commit c513f5c6f5
116 files changed
+507 -507

No files matched your search

@@ -6,10 +6,10 @@ namespace HandyControl.Controls;
public class CompareSlider : Slider
{
public static readonly DependencyProperty TargetContentProperty = DependencyProperty.Register(
"TargetContent", typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object)));
nameof(TargetContent), typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object)));
public static readonly DependencyProperty SourceContentProperty = DependencyProperty.Register(
"SourceContent", typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object)));
nameof(SourceContent), typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object)));
public object TargetContent
{
@@ -33,7 +33,7 @@ public class PreviewSlider : Slider
/// 预览内容
/// </summary>
public static readonly DependencyProperty PreviewContentProperty = DependencyProperty.Register(
"PreviewContent", typeof(object), typeof(PreviewSlider), new PropertyMetadata(default(object)));
nameof(PreviewContent), typeof(object), typeof(PreviewSlider), new PropertyMetadata(default(object)));
/// <summary>
/// 预览内容
@@ -45,7 +45,7 @@ public class PreviewSlider : Slider
}
public static readonly DependencyProperty PreviewContentOffsetProperty = DependencyProperty.Register(
"PreviewContentOffset", typeof(double), typeof(PreviewSlider), new PropertyMetadata(9.0));
nameof(PreviewContentOffset), typeof(double), typeof(PreviewSlider), new PropertyMetadata(9.0));
public double PreviewContentOffset
{
@@ -132,7 +132,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(RangeSlider), new PropertyMetadata(default(Orientation)));
nameof(Orientation), typeof(Orientation), typeof(RangeSlider), new PropertyMetadata(default(Orientation)));
public Orientation Orientation
{
@@ -141,7 +141,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register(
"IsDirectionReversed", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
nameof(IsDirectionReversed), typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDirectionReversed
{
@@ -182,7 +182,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty AutoToolTipPlacementProperty = DependencyProperty.Register(
"AutoToolTipPlacement", typeof(AutoToolTipPlacement), typeof(RangeSlider), new PropertyMetadata(default(AutoToolTipPlacement)));
nameof(AutoToolTipPlacement), typeof(AutoToolTipPlacement), typeof(RangeSlider), new PropertyMetadata(default(AutoToolTipPlacement)));
public AutoToolTipPlacement AutoToolTipPlacement
{
@@ -191,7 +191,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty AutoToolTipPrecisionProperty = DependencyProperty.Register(
"AutoToolTipPrecision", typeof(int), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Int0Box),
nameof(AutoToolTipPrecision), typeof(int), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Int0Box),
ValidateHelper.IsInRangeOfPosIntIncludeZero);
public int AutoToolTipPrecision
@@ -201,7 +201,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty IsSnapToTickEnabledProperty = DependencyProperty.Register(
"IsSnapToTickEnabled", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
nameof(IsSnapToTickEnabled), typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsSnapToTickEnabled
{
@@ -210,7 +210,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty TickPlacementProperty = DependencyProperty.Register(
"TickPlacement", typeof(TickPlacement), typeof(RangeSlider), new PropertyMetadata(default(TickPlacement)));
nameof(TickPlacement), typeof(TickPlacement), typeof(RangeSlider), new PropertyMetadata(default(TickPlacement)));
public TickPlacement TickPlacement
{
@@ -219,7 +219,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty TickFrequencyProperty = DependencyProperty.Register(
"TickFrequency", typeof(double), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Double1Box),
nameof(TickFrequency), typeof(double), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Double1Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double TickFrequency
@@ -229,7 +229,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty TicksProperty = DependencyProperty.Register(
"Ticks", typeof(DoubleCollection), typeof(RangeSlider), new PropertyMetadata(new DoubleCollection()));
nameof(Ticks), typeof(DoubleCollection), typeof(RangeSlider), new PropertyMetadata(new DoubleCollection()));
public DoubleCollection Ticks
{
@@ -238,7 +238,7 @@ public class RangeSlider : TwoWayRangeBase
}
public static readonly DependencyProperty IsMoveToPointEnabledProperty = DependencyProperty.Register(
"IsMoveToPointEnabled", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
nameof(IsMoveToPointEnabled), typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsMoveToPointEnabled
{
@@ -8,7 +8,7 @@ namespace HandyControl.Controls;
public class RangeThumb : Thumb
{
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(RangeThumb), new PropertyMetadata(default(object)));
nameof(Content), typeof(object), typeof(RangeThumb), new PropertyMetadata(default(object)));
public object Content
{
@@ -109,7 +109,7 @@ public class RangeTrack : FrameworkElement
}
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(RangeTrack),
nameof(Orientation), typeof(Orientation), typeof(RangeTrack),
new FrameworkPropertyMetadata(default(Orientation), FrameworkPropertyMetadataOptions.AffectsMeasure));
public Orientation Orientation
@@ -119,7 +119,7 @@ public class RangeTrack : FrameworkElement
}
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
"Minimum", typeof(double), typeof(RangeTrack),
nameof(Minimum), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsArrange));
public double Minimum
@@ -129,7 +129,7 @@ public class RangeTrack : FrameworkElement
}
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(double), typeof(RangeTrack),
nameof(Maximum), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double1Box, FrameworkPropertyMetadataOptions.AffectsArrange));
public double Maximum
@@ -139,7 +139,7 @@ public class RangeTrack : FrameworkElement
}
public static readonly DependencyProperty ValueStartProperty = DependencyProperty.Register(
"ValueStart", typeof(double), typeof(RangeTrack),
nameof(ValueStart), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
FrameworkPropertyMetadataOptions.AffectsArrange));
@@ -151,7 +151,7 @@ public class RangeTrack : FrameworkElement
}
public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register(
"ValueEnd", typeof(double), typeof(RangeTrack),
nameof(ValueEnd), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
FrameworkPropertyMetadataOptions.AffectsArrange));
@@ -163,7 +163,7 @@ public class RangeTrack : FrameworkElement
}
public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register(
"IsDirectionReversed", typeof(bool), typeof(RangeTrack), new PropertyMetadata(ValueBoxes.FalseBox));
nameof(IsDirectionReversed), typeof(bool), typeof(RangeTrack), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDirectionReversed
{
@@ -10,7 +10,7 @@ namespace HandyControl.Controls;
public class TwoWayRangeBase : Control
{
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
"Minimum", typeof(double), typeof(TwoWayRangeBase),
nameof(Minimum), typeof(double), typeof(TwoWayRangeBase),
new PropertyMetadata(ValueBoxes.Double0Box, OnMinimumChanged), ValidateHelper.IsInRangeOfDouble);
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -34,7 +34,7 @@ public class TwoWayRangeBase : Control
}
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(double), typeof(TwoWayRangeBase),
nameof(Maximum), typeof(double), typeof(TwoWayRangeBase),
new PropertyMetadata(ValueBoxes.Double10Box, OnMaximumChanged, CoerceMaximum),
ValidateHelper.IsInRangeOfDouble);
@@ -69,7 +69,7 @@ public class TwoWayRangeBase : Control
}
public static readonly DependencyProperty ValueStartProperty = DependencyProperty.Register(
"ValueStart", typeof(double), typeof(TwoWayRangeBase),
nameof(ValueStart), typeof(double), typeof(TwoWayRangeBase),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal,
OnValueStartChanged, ConstrainToRange), ValidateHelper.IsInRangeOfDouble);
@@ -98,7 +98,7 @@ public class TwoWayRangeBase : Control
}
public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register(
"ValueEnd", typeof(double), typeof(TwoWayRangeBase),
nameof(ValueEnd), typeof(double), typeof(TwoWayRangeBase),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal,
OnValueEndChanged, ConstrainToRange), ValidateHelper.IsInRangeOfDouble);
@@ -143,7 +143,7 @@ public class TwoWayRangeBase : Control
}
public static readonly DependencyProperty LargeChangeProperty = DependencyProperty.Register(
"LargeChange", typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double1Box),
nameof(LargeChange), typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double1Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double LargeChange
@@ -153,7 +153,7 @@ public class TwoWayRangeBase : Control
}
public static readonly DependencyProperty SmallChangeProperty = DependencyProperty.Register(
"SmallChange", typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double01Box),
nameof(SmallChange), typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double01Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double SmallChange