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

@@ -13,18 +13,18 @@ namespace HandyControl.Controls;
public class HighlightTextBlock : TextBlock
{
public static readonly DependencyProperty SourceTextProperty =
DependencyProperty.Register("SourceText", typeof(string), typeof(HighlightTextBlock),
DependencyProperty.Register(nameof(SourceText), typeof(string), typeof(HighlightTextBlock),
new PropertyMetadata(null, OnSourceTextChanged));
public static readonly DependencyProperty QueriesTextProperty =
DependencyProperty.Register("QueriesText", typeof(string), typeof(HighlightTextBlock),
DependencyProperty.Register(nameof(QueriesText), typeof(string), typeof(HighlightTextBlock),
new PropertyMetadata(null, OnQueriesTextChanged));
public static readonly DependencyProperty HighlightBrushProperty =
DependencyProperty.Register("HighlightBrush", typeof(Brush), typeof(HighlightTextBlock));
DependencyProperty.Register(nameof(HighlightBrush), typeof(Brush), typeof(HighlightTextBlock));
public static readonly DependencyProperty HighlightTextBrushProperty =
DependencyProperty.Register("HighlightTextBrush", typeof(Brush), typeof(HighlightTextBlock));
DependencyProperty.Register(nameof(HighlightTextBrush), typeof(Brush), typeof(HighlightTextBlock));
private static void OnSourceTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
((HighlightTextBlock) d).RefreshInlines();
@@ -25,7 +25,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty StrokePositionProperty = DependencyProperty.Register(
"StrokePosition", typeof(StrokePosition), typeof(OutlineText), new PropertyMetadata(default(StrokePosition)));
nameof(StrokePosition), typeof(StrokePosition), typeof(OutlineText), new PropertyMetadata(default(StrokePosition)));
public StrokePosition StrokePosition
{
@@ -34,7 +34,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(OutlineText), new FrameworkPropertyMetadata(
nameof(Text), typeof(string), typeof(OutlineText), new FrameworkPropertyMetadata(
string.Empty,
FrameworkPropertyMetadataOptions.AffectsMeasure |
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
@@ -46,7 +46,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register(
"TextAlignment", typeof(TextAlignment), typeof(OutlineText),
nameof(TextAlignment), typeof(TextAlignment), typeof(OutlineText),
new PropertyMetadata(default(TextAlignment), OnFormattedTextUpdated));
public TextAlignment TextAlignment
@@ -56,7 +56,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty TextTrimmingProperty = DependencyProperty.Register(
"TextTrimming", typeof(TextTrimming), typeof(OutlineText),
nameof(TextTrimming), typeof(TextTrimming), typeof(OutlineText),
new PropertyMetadata(default(TextTrimming), OnFormattedTextInvalidated));
public TextTrimming TextTrimming
@@ -66,7 +66,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register(
"TextWrapping", typeof(TextWrapping), typeof(OutlineText),
nameof(TextWrapping), typeof(TextWrapping), typeof(OutlineText),
new PropertyMetadata(TextWrapping.NoWrap, OnFormattedTextInvalidated));
public TextWrapping TextWrapping
@@ -76,7 +76,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty FillProperty = DependencyProperty.Register(
"Fill", typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
nameof(Fill), typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
public Brush Fill
{
@@ -85,7 +85,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty StrokeProperty = DependencyProperty.Register(
"Stroke", typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
nameof(Stroke), typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
public Brush Stroke
{
@@ -94,7 +94,7 @@ public class OutlineText : FrameworkElement
}
public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register(
"StrokeThickness", typeof(double), typeof(OutlineText), new PropertyMetadata(ValueBoxes.Double0Box, OnFormattedTextUpdated));
nameof(StrokeThickness), typeof(double), typeof(OutlineText), new PropertyMetadata(ValueBoxes.Double0Box, OnFormattedTextUpdated));
public double StrokeThickness
{
@@ -19,7 +19,7 @@ public class SimpleText : FrameworkElement
}
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(SimpleText), new FrameworkPropertyMetadata(
nameof(Text), typeof(string), typeof(SimpleText), new FrameworkPropertyMetadata(
string.Empty,
FrameworkPropertyMetadataOptions.AffectsMeasure |
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
@@ -31,7 +31,7 @@ public class SimpleText : FrameworkElement
}
public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register(
"TextAlignment", typeof(TextAlignment), typeof(SimpleText),
nameof(TextAlignment), typeof(TextAlignment), typeof(SimpleText),
new PropertyMetadata(default(TextAlignment), OnFormattedTextUpdated));
public TextAlignment TextAlignment
@@ -41,7 +41,7 @@ public class SimpleText : FrameworkElement
}
public static readonly DependencyProperty TextTrimmingProperty = DependencyProperty.Register(
"TextTrimming", typeof(TextTrimming), typeof(SimpleText),
nameof(TextTrimming), typeof(TextTrimming), typeof(SimpleText),
new PropertyMetadata(default(TextTrimming), OnFormattedTextInvalidated));
public TextTrimming TextTrimming
@@ -51,7 +51,7 @@ public class SimpleText : FrameworkElement
}
public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register(
"TextWrapping", typeof(TextWrapping), typeof(SimpleText),
nameof(TextWrapping), typeof(TextWrapping), typeof(SimpleText),
new PropertyMetadata(TextWrapping.NoWrap, OnFormattedTextInvalidated));
public TextWrapping TextWrapping
@@ -61,7 +61,7 @@ public class SimpleText : FrameworkElement
}
public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register(
"Foreground", typeof(Brush), typeof(SimpleText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
nameof(Foreground), typeof(Brush), typeof(SimpleText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
public Brush Foreground
{