Skip to content

Commit ef742b5

Browse files
committed
Format code
1 parent 8ebf43e commit ef742b5

File tree

3 files changed

+44
-34
lines changed

3 files changed

+44
-34
lines changed

src/Wpf.Ui/Controls/Arc/Arc.cs

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
using System.Windows.Shapes;
88
using Point = System.Windows.Point;
99
using Size = System.Windows.Size;
10-
// ReSharper disable CheckNamespace
11-
#pragma warning disable CS0108
1210

11+
// ReSharper disable CheckNamespace
1312
namespace Wpf.Ui.Controls;
1413

1514
/// <summary>
@@ -46,22 +45,20 @@ public class Arc : Shape
4645
);
4746

4847
/// <summary>Identifies the <see cref="SweepDirection"/> dependency property.</summary>
49-
public static readonly DependencyProperty SweepDirectionProperty =
50-
DependencyProperty.Register(
51-
nameof(SweepDirection),
52-
typeof(SweepDirection),
53-
typeof(Arc),
54-
new PropertyMetadata(SweepDirection.Clockwise, PropertyChangedCallback)
55-
);
48+
public static readonly DependencyProperty SweepDirectionProperty = DependencyProperty.Register(
49+
nameof(SweepDirection),
50+
typeof(SweepDirection),
51+
typeof(Arc),
52+
new PropertyMetadata(SweepDirection.Clockwise, PropertyChangedCallback)
53+
);
5654

5755
/// <summary>Identifies the <see cref="StrokeStartLineCap"/> dependency property.</summary>
58-
public static readonly DependencyProperty StrokeStartLineCapProperty =
59-
DependencyProperty.Register(
60-
nameof(StrokeStartLineCap),
61-
typeof(PenLineCap),
62-
typeof(Arc),
63-
new PropertyMetadata(PenLineCap.Round, PropertyChangedCallback)
64-
);
56+
public static readonly DependencyProperty StrokeStartLineCapProperty = DependencyProperty.Register(
57+
nameof(StrokeStartLineCap),
58+
typeof(PenLineCap),
59+
typeof(Arc),
60+
new PropertyMetadata(PenLineCap.Round, PropertyChangedCallback)
61+
);
6562

6663
/// <summary>
6764
/// Gets or sets the initial angle from which the arc will be drawn.
@@ -90,7 +87,8 @@ public SweepDirection SweepDirection
9087
set => SetValue(SweepDirectionProperty, value);
9188
}
9289

93-
public PenLineCap StrokeStartLineCap
90+
// TODO: Should we?
91+
public new PenLineCap StrokeStartLineCap
9492
{
9593
get { return (PenLineCap)GetValue(StrokeStartLineCapProperty); }
9694
set { SetValue(StrokeStartLineCapProperty, value); }
@@ -165,7 +163,10 @@ protected Point PointAtAngle(double angle)
165163
var xRadius = (RenderSize.Width - StrokeThickness) / 2;
166164
var yRadius = (RenderSize.Height - StrokeThickness) / 2;
167165

168-
return new Point(xRadius + (xRadius * Math.Cos(radAngle)), yRadius - (yRadius * Math.Sin(radAngle)));
166+
return new Point(
167+
xRadius + (xRadius * Math.Cos(radAngle)),
168+
yRadius - (yRadius * Math.Sin(radAngle))
169+
);
169170
}
170171
else
171172
{
@@ -180,7 +181,10 @@ protected Point PointAtAngle(double angle)
180181
var xRadius = (RenderSize.Width - StrokeThickness) / 2;
181182
var yRadius = (RenderSize.Height - StrokeThickness) / 2;
182183

183-
return new Point(xRadius + (xRadius * Math.Cos(-radAngle)), yRadius - (yRadius * Math.Sin(-radAngle)));
184+
return new Point(
185+
xRadius + (xRadius * Math.Cos(-radAngle)),
186+
yRadius - (yRadius * Math.Sin(-radAngle))
187+
);
184188
}
185189
}
186190

@@ -231,11 +235,12 @@ protected override Size ArrangeOverride(Size finalSize)
231235
protected override void OnRender(DrawingContext drawingContext)
232236
{
233237
base.OnRender(drawingContext);
234-
Pen pen = new(Stroke, StrokeThickness)
235-
{
236-
StartLineCap = StrokeStartLineCap,
237-
EndLineCap = StrokeStartLineCap
238-
};
238+
Pen pen =
239+
new(Stroke, StrokeThickness)
240+
{
241+
StartLineCap = StrokeStartLineCap,
242+
EndLineCap = StrokeStartLineCap
243+
};
239244

240245
drawingContext.DrawGeometry(Stroke, pen, DefinedGeometry());
241246
}

src/Wpf.Ui/Markup/FontIconExtension.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ namespace Wpf.Ui.Markup;
3232
[MarkupExtensionReturnType(typeof(FontIcon))]
3333
public class FontIconExtension : MarkupExtension
3434
{
35-
public FontIconExtension()
36-
{
37-
}
35+
public FontIconExtension() { }
3836

3937
public FontIconExtension(string glyph)
4038
{
@@ -51,7 +49,12 @@ public FontIconExtension(string glyph)
5149

5250
public override object ProvideValue(IServiceProvider serviceProvider)
5351
{
54-
if (serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget { TargetObject: Setter })
52+
if (
53+
serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget
54+
{
55+
TargetObject: Setter
56+
}
57+
)
5558
{
5659
return this;
5760
}
@@ -65,4 +68,4 @@ public override object ProvideValue(IServiceProvider serviceProvider)
6568

6669
return fontIcon;
6770
}
68-
}
71+
}

src/Wpf.Ui/Markup/SymbolIconExtension.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ namespace Wpf.Ui.Markup;
3232
[MarkupExtensionReturnType(typeof(SymbolIcon))]
3333
public class SymbolIconExtension : MarkupExtension
3434
{
35-
36-
public SymbolIconExtension()
37-
{
38-
}
35+
public SymbolIconExtension() { }
3936

4037
public SymbolIconExtension(SymbolRegular symbol)
4138
{
@@ -63,7 +60,12 @@ public SymbolIconExtension(SymbolRegular symbol, bool filled)
6360

6461
public override object ProvideValue(IServiceProvider serviceProvider)
6562
{
66-
if (serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget { TargetObject: Setter })
63+
if (
64+
serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget
65+
{
66+
TargetObject: Setter
67+
}
68+
)
6769
{
6870
return this;
6971
}

0 commit comments

Comments
 (0)