Skip to content

Commit be9d368

Browse files
committed
Apply file scoped namespace
1 parent f4e4fd8 commit be9d368

355 files changed

Lines changed: 26164 additions & 26481 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ csharp_style_prefer_range_operator = true:suggestion
141141
[*.cs]
142142
csharp_style_deconstructed_variable_declaration = true:suggestion
143143
csharp_style_pattern_local_over_anonymous_function = true:suggestion
144-
csharp_using_directive_placement = inside_namespace:warning
144+
csharp_using_directive_placement = outside_namespace:warning
145+
csharp_style_namespace_declarations = file_scoped:warning
145146
csharp_prefer_static_local_function = true:suggestion
146147
csharp_prefer_simple_using_statement = true:suggestion
147148
csharp_style_prefer_switch_expression = true:suggestion
Lines changed: 91 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,111 @@
1-
namespace AzureMapsControl.Components.Animations
2-
{
3-
using System.Threading.Tasks;
1+

2+
using System.Threading.Tasks;
43

5-
using AzureMapsControl.Components.Animations.Options;
6-
using AzureMapsControl.Components.Runtime;
4+
using AzureMapsControl.Components.Animations.Options;
5+
using AzureMapsControl.Components.Runtime;
76

8-
internal abstract class Animation : IAnimation
9-
{
10-
private readonly string _id;
7+
namespace AzureMapsControl.Components.Animations;
8+
internal abstract class Animation : IAnimation
9+
{
10+
private readonly string _id;
1111

12-
internal readonly IMapJsRuntime JsRuntime;
12+
internal readonly IMapJsRuntime JsRuntime;
1313

14-
public string Id => _id;
15-
public bool Disposed { get; internal set; }
14+
public string Id => _id;
15+
public bool Disposed { get; internal set; }
1616

17-
internal Animation(string id, IMapJsRuntime jsRuntime)
18-
{
19-
_id = id;
20-
JsRuntime = jsRuntime;
21-
}
17+
internal Animation(string id, IMapJsRuntime jsRuntime)
18+
{
19+
_id = id;
20+
JsRuntime = jsRuntime;
21+
}
2222

23-
/// <summary>
24-
/// Disposes the animation
25-
/// </summary>
26-
/// <returns></returns>
27-
public virtual async ValueTask DisposeAsync()
28-
{
29-
EnsureNotDisposed();
30-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Dispose.ToAnimationNamespace(), Id).ConfigureAwait(false);
31-
Disposed = true;
32-
}
23+
/// <summary>
24+
/// Disposes the animation
25+
/// </summary>
26+
/// <returns></returns>
27+
public virtual async ValueTask DisposeAsync()
28+
{
29+
EnsureNotDisposed();
30+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Dispose.ToAnimationNamespace(), Id).ConfigureAwait(false);
31+
Disposed = true;
32+
}
3333

34-
/// <summary>
35-
/// Pauses the animation.
36-
/// </summary>
37-
/// <returns></returns>
38-
public virtual async ValueTask PauseAsync()
39-
{
40-
EnsureNotDisposed();
41-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Pause.ToAnimationNamespace(), Id).ConfigureAwait(false);
42-
}
34+
/// <summary>
35+
/// Pauses the animation.
36+
/// </summary>
37+
/// <returns></returns>
38+
public virtual async ValueTask PauseAsync()
39+
{
40+
EnsureNotDisposed();
41+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Pause.ToAnimationNamespace(), Id).ConfigureAwait(false);
42+
}
4343

44-
/// <summary>
45-
/// Plays the animation.
46-
/// </summary>
47-
/// <returns></returns>
48-
public virtual async ValueTask PlayAsync()
49-
{
50-
EnsureNotDisposed();
51-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Play.ToAnimationNamespace(), Id).ConfigureAwait(false);
52-
}
44+
/// <summary>
45+
/// Plays the animation.
46+
/// </summary>
47+
/// <returns></returns>
48+
public virtual async ValueTask PlayAsync()
49+
{
50+
EnsureNotDisposed();
51+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Play.ToAnimationNamespace(), Id).ConfigureAwait(false);
52+
}
5353

54-
/// <summary>
55-
/// Stops the animation and jumps back to the beginning of the animation.
56-
/// </summary>
57-
/// <returns></returns>
58-
public virtual async ValueTask ResetAsync()
59-
{
60-
EnsureNotDisposed();
61-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Reset.ToAnimationNamespace(), Id).ConfigureAwait(false);
62-
}
54+
/// <summary>
55+
/// Stops the animation and jumps back to the beginning of the animation.
56+
/// </summary>
57+
/// <returns></returns>
58+
public virtual async ValueTask ResetAsync()
59+
{
60+
EnsureNotDisposed();
61+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Reset.ToAnimationNamespace(), Id).ConfigureAwait(false);
62+
}
6363

64-
/// <summary>
65-
/// Stops the animation and jumps back to the end of the animation.
66-
/// </summary>
67-
/// <returns></returns>
68-
public virtual async ValueTask StopAsync()
69-
{
70-
EnsureNotDisposed();
71-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Stop.ToAnimationNamespace(), Id).ConfigureAwait(false);
72-
}
64+
/// <summary>
65+
/// Stops the animation and jumps back to the end of the animation.
66+
/// </summary>
67+
/// <returns></returns>
68+
public virtual async ValueTask StopAsync()
69+
{
70+
EnsureNotDisposed();
71+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Stop.ToAnimationNamespace(), Id).ConfigureAwait(false);
72+
}
7373

74-
/// <summary>
75-
/// Advances the animation to specific step.
76-
/// </summary>
77-
/// <param name="progress">The progress of the animation to advance to. A value between 0 and 1.</param>
78-
/// <returns></returns>
79-
public virtual async ValueTask SeekAsync(decimal progress)
80-
{
81-
EnsureNotDisposed();
82-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Seek.ToAnimationNamespace(), Id, progress).ConfigureAwait(false);
83-
}
74+
/// <summary>
75+
/// Advances the animation to specific step.
76+
/// </summary>
77+
/// <param name="progress">The progress of the animation to advance to. A value between 0 and 1.</param>
78+
/// <returns></returns>
79+
public virtual async ValueTask SeekAsync(decimal progress)
80+
{
81+
EnsureNotDisposed();
82+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Seek.ToAnimationNamespace(), Id, progress).ConfigureAwait(false);
83+
}
8484

85-
protected void EnsureNotDisposed()
85+
protected void EnsureNotDisposed()
86+
{
87+
if (Disposed)
8688
{
87-
if (Disposed)
88-
{
89-
throw new AnimationDisposedException();
90-
}
89+
throw new AnimationDisposedException();
9190
}
9291
}
92+
}
9393

94-
internal abstract class Animation<TOptions> : Animation
95-
where TOptions : IAnimationOptions
94+
internal abstract class Animation<TOptions> : Animation
95+
where TOptions : IAnimationOptions
96+
{
97+
internal Animation(string id, IMapJsRuntime jsRuntime) : base(id, jsRuntime)
9698
{
97-
internal Animation(string id, IMapJsRuntime jsRuntime) : base(id, jsRuntime)
98-
{
99-
}
99+
}
100100

101-
/// <summary>
102-
/// Sets the options of the animation.
103-
/// </summary>
104-
/// <param name="options">Options to update the animation with</param>
105-
/// <returns></returns>
106-
public virtual async ValueTask SetOptionsAsync(TOptions options)
107-
{
108-
EnsureNotDisposed();
109-
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.SetOptions.ToAnimationNamespace(), Id, options).ConfigureAwait(false);
110-
}
101+
/// <summary>
102+
/// Sets the options of the animation.
103+
/// </summary>
104+
/// <param name="options">Options to update the animation with</param>
105+
/// <returns></returns>
106+
public virtual async ValueTask SetOptionsAsync(TOptions options)
107+
{
108+
EnsureNotDisposed();
109+
await JsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.SetOptions.ToAnimationNamespace(), Id, options).ConfigureAwait(false);
111110
}
112111
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
namespace AzureMapsControl.Components.Animations
2-
{
3-
using AzureMapsControl.Components.Exceptions;
1+

2+
using AzureMapsControl.Components.Exceptions;
43

5-
public sealed class AnimationDisposedException : ComponentDisposedException
6-
{
7-
internal AnimationDisposedException(): base("This animation has already been disposed") { }
8-
}
4+
namespace AzureMapsControl.Components.Animations;
5+
public sealed class AnimationDisposedException : ComponentDisposedException
6+
{
7+
internal AnimationDisposedException(): base("This animation has already been disposed") { }
98
}

0 commit comments

Comments
 (0)