Skip to content

Commit fd69611

Browse files
dotnet format
1 parent 473c783 commit fd69611

File tree

12 files changed

+29
-28
lines changed

12 files changed

+29
-28
lines changed

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/DrawingViewViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
1313
public partial class DrawingViewViewModel : BaseViewModel
1414
{
1515
readonly IFileSaver fileSaver;
16-
16+
1717
public List<DrawingViewOutputOption> AvailableOutputOptions { get; } = [DrawingViewOutputOption.Lines, DrawingViewOutputOption.FullCanvas];
18-
18+
1919
[ObservableProperty]
2020
public partial string Logs { get; private set; } = string.Empty;
2121

2222
[ObservableProperty]
2323
public partial DrawingViewOutputOption SelectedOutputOption { get; set; } = DrawingViewOutputOption.Lines;
24-
24+
2525
public double CanvasHeight { get; set; }
26-
26+
2727
public double CanvasWidth { get; set; }
2828

2929
public DrawingViewViewModel(IFileSaver fileSaver)
@@ -84,7 +84,7 @@ async Task Save(CancellationToken cancellationToken)
8484
var options = SelectedOutputOption == DrawingViewOutputOption.Lines
8585
? ImageLineOptions.JustLines(Lines.ToList(), new Size(1920, 1080), Brush.Blue)
8686
: ImageLineOptions.FullCanvas(Lines.ToList(), new Size(1920, 1080), Brush.Blue, new Size(CanvasWidth, CanvasHeight));
87-
87+
8888
await using var stream = await DrawingView.GetImageStream(options, cancellationToken);
8989

9090
await Permissions.RequestAsync<Permissions.StorageRead>().WaitAsync(cancellationToken);

src/CommunityToolkit.Maui.Core/Interfaces/IDrawingLine.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public interface IDrawingLine
4242
/// <returns><see cref="ValueTask{Stream}"/> containing the data of the requested image with data that's currently on the <see cref="IDrawingLine"/>.</returns>
4343
ValueTask<Stream> GetImageStream(double desiredSizeWidth, double desiredSizeHeight, Paint background, CancellationToken token = default) =>
4444
GetImageStream(desiredSizeWidth, desiredSizeHeight, background, null, token);
45-
45+
4646
/// <summary>
4747
/// Retrieves a <see cref="Stream"/> containing an image of this line, based on the <see cref="Points"/> data.
4848
/// </summary>

src/CommunityToolkit.Maui.Core/Interfaces/IDrawingView.shared.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public interface IDrawingView : IView
4848
/// <param name="token"> <see cref="CancellationToken"/>.</param>
4949
/// <returns><see cref="Task{Stream}"/> containing the data of the requested image with data that's currently on the <see cref="IDrawingView"/>.</returns>
5050
ValueTask<Stream> GetImageStream(double desiredWidth, double desiredHeight, CancellationToken token = default) => GetImageStream(desiredWidth, desiredHeight, DrawingViewOutputOption.Lines, token);
51-
51+
5252
/// <summary>
5353
/// Retrieves a <see cref="Stream"/> containing an image of the <see cref="Lines"/> that are currently drawn on the <see cref="IDrawingView"/>.
5454
/// </summary>
@@ -86,4 +86,4 @@ public interface IDrawingView : IView
8686
/// </summary>
8787
/// <param name="lastDrawingLine">Last drawing line</param>
8888
void OnDrawingLineCompleted(IDrawingLine lastDrawingLine);
89-
}
89+
}

src/CommunityToolkit.Maui.Core/Primitives/DrawingViewOutputOption.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public enum DrawingViewOutputOption
99
/// Outputs the area covered by the top-left to the bottom-right most points.
1010
/// </summary>
1111
Lines,
12-
12+
1313
/// <summary>
1414
/// Outputs the full area displayed within the drawing view.
1515
/// </summary>

src/CommunityToolkit.Maui.Core/Views/DrawingView/DrawingLine.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public static ValueTask<Stream> GetImageStream(
4848
DrawingViewService.GetImageStream(options, token);
4949

5050
/// <inheritdoc cref="IDrawingLine.GetImageStream(double, double, Paint, Size?, CancellationToken)"/>
51-
public ValueTask<Stream> GetImageStream(double desiredSizeWidth, double desiredSizeHeight, Paint background, Size? canvasSize = null, CancellationToken token = default) =>
51+
public ValueTask<Stream> GetImageStream(double desiredSizeWidth, double desiredSizeHeight, Paint background, Size? canvasSize = null, CancellationToken token = default) =>
5252
DrawingViewService.GetImageStream(new ImagePointOptions([.. Points], new Size(desiredSizeWidth, desiredSizeHeight), LineWidth, LineColor, background, canvasSize), token);
5353
}

src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.android.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static Stream GetBitmapStream(Bitmap? image, Size imageSize)
130130
{
131131
return (null, SizeF.Zero);
132132
}
133-
133+
134134
var offset = canvasSize is null ? new SizeF(minPointX, minPointY) : SizeF.Zero;
135135

136136
return (image, offset);

src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.shared.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static partial class DrawingViewService
99
/// <param name="token"><see cref="CancellationToken"/></param>
1010
/// <returns>Image stream</returns>
1111
public static ValueTask<Stream> GetImageStream(ImagePointOptions options, CancellationToken token = default) =>
12-
GetPlatformImageStream(options, token);
12+
GetPlatformImageStream(options, token);
1313

1414
/// <summary>
1515
/// Get image stream from lines
@@ -35,12 +35,12 @@ public abstract class ImageOptions(Size desiredSize, Paint? background, Size? ca
3535
/// Gets the desired dimensions of the generated image. The image will be resized proportionally.
3636
/// </summary>
3737
public Size DesiredSize { get; } = desiredSize;
38-
38+
3939
/// <summary>
4040
/// Gets the background <see cref="Paint"/> to apply to the output image.
4141
/// </summary>
4242
public Paint? Background { get; } = background;
43-
43+
4444
/// <summary>
4545
/// Gets the actual size of the canvas being displayed.
4646
/// if a value is provided then the contents of the drawing inside these dimensions will be included in the output,
@@ -66,12 +66,12 @@ public class ImagePointOptions(IList<PointF> points, Size desiredSize, float lin
6666
/// Gets the points that will result in a single line.
6767
/// </summary>
6868
public IList<PointF> Points { get; } = points;
69-
69+
7070
/// <summary>
7171
/// Gets the width of the line to render.
7272
/// </summary>
7373
public float LineWidth { get; } = lineWidth;
74-
74+
7575
/// <summary>
7676
/// Gets the <see cref="Color"/> of the line to render.
7777
/// </summary>
@@ -100,7 +100,7 @@ public static ImageLineOptions JustLines(IList<IDrawingLine> lines, Size desired
100100
{
101101
return new ImageLineOptions(lines, desiredSize, background, null);
102102
}
103-
103+
104104
/// <summary>
105105
/// Creates an instance of <see cref="ImageLineOptions"/> that will result in the contents of the drawing inside the supplied <paramref name="canvasSize"/> will be included in the output,
106106
/// </summary>
@@ -113,7 +113,7 @@ public static ImageLineOptions FullCanvas(IList<IDrawingLine> lines, Size desire
113113
{
114114
return new ImageLineOptions(lines, desiredSize, background, canvasSize);
115115
}
116-
116+
117117
/// <summary>
118118
/// Gets the lines that will be rendered in the resulting image.
119119
/// </summary>

src/CommunityToolkit.Maui.UnitTests/Essentials/SpeechToTextTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ public async Task StartStopListenAsyncShouldChangeRecognitionText()
6262
void OnRecognitionTextUpdated(object? sender, SpeechToTextRecognitionResultUpdatedEventArgs args)
6363
{
6464
currentPartialText = args.RecognitionResult;
65-
};
65+
}
66+
6667
void OnRecognitionTextCompleted(object? sender, SpeechToTextRecognitionResultCompletedEventArgs args)
6768
{
6869
currentFinalText = args.RecognitionResult.Text;
69-
};
70+
}
7071
}
7172

7273
[Fact(Timeout = (int)TestDuration.Short)]

src/CommunityToolkit.Maui.UnitTests/Views/DrawingView/DrawingLineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public async Task GetImageStreamReturnsNullStream()
102102
public async Task GetImageStreamStaticReturnsNullStream()
103103
{
104104
ImagePointOptions pointOptions = new([], new Size(10, 10), 5, Colors.Yellow, Colors.Blue.AsPaint(), null);
105-
var stream = await DrawingLine.GetImageStream(pointOptions, TestContext.Current.CancellationToken);
105+
var stream = await DrawingLine.GetImageStream(pointOptions, TestContext.Current.CancellationToken);
106106
Assert.Equal(Stream.Null, stream);
107107
}
108108

src/CommunityToolkit.Maui.UnitTests/Views/DrawingView/DrawingViewTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ public async Task GetImageStream_CancellationTokenExpired()
160160
await Task.Delay(100, TestContext.Current.CancellationToken);
161161

162162
ImageLineOptions options = ImageLineOptions.JustLines([new DrawingLine()], Size.Zero, Colors.Transparent.AsPaint());
163-
164-
await Assert.ThrowsAsync<OperationCanceledException>(async () => await DrawingView.GetImageStream(options, cts.Token));
163+
164+
await Assert.ThrowsAsync<OperationCanceledException>(async () => await DrawingView.GetImageStream(options, cts.Token));
165165
}
166166

167167
[Fact(Timeout = (int)TestDuration.Short)]
@@ -173,8 +173,8 @@ public async Task GetImageStream_CancellationTokenCanceled()
173173
await cts.CancelAsync();
174174

175175
ImageLineOptions options = ImageLineOptions.JustLines([new DrawingLine()], Size.Zero, Colors.Transparent.AsPaint());
176-
177-
await Assert.ThrowsAsync<OperationCanceledException>(async () => await DrawingView.GetImageStream(options, cts.Token));
176+
177+
await Assert.ThrowsAsync<OperationCanceledException>(async () => await DrawingView.GetImageStream(options, cts.Token));
178178
}
179179

180180
[Fact(Timeout = (int)TestDuration.Short)]

0 commit comments

Comments
 (0)