Skip to content

Commit 3116ff3

Browse files
CopilotCopilot
andcommitted
Add XML documentation comments to all public types and members in SkiaSharp.Extended.UI.Maui
Add XML doc comments (/// <summary>, /// <param>, /// <returns>) to all public classes, structs, enums, properties, methods, constructors, fields, and events in the SkiaSharp.Extended.UI.Maui project to eliminate CS1591 warnings. Files documented: - Base controls: SKSurfaceView, SKAnimatedSurfaceView, StringTypeConverter - Confetti controls: SKConfettiView, SKConfettiSystem, SKConfettiEmitter, SKConfettiEmitterBounds, SKConfettiPhysics, SKConfettiShape (and subtypes), all collection types and type converters - Lottie controls: SKLottieView, SKLottieAnimation, SKLottieImageSource (and subtypes), event args, type converters - Resource dictionaries: SKSurfaceViewResources, SKConfettiViewResources, SKLottieViewResources - Enums: SKConfettiEmitterSide, SKLottieRepeatMode Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2d9e76c commit 3116ff3

30 files changed

+720
-0
lines changed

source/SkiaSharp.Extended.UI.Maui/Controls/Confetti/SKConfettiColorCollection.shared.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
namespace SkiaSharp.Extended.UI.Controls;
22

3+
/// <summary>
4+
/// A collection of <see cref="Color"/> values used for confetti particles.
5+
/// </summary>
36
[TypeConverter(typeof(Converters.SKConfettiColorCollectionTypeConverter))]
47
public class SKConfettiColorCollection : List<Color>
58
{
9+
/// <summary>
10+
/// Initializes a new instance of the <see cref="SKConfettiColorCollection"/> class.
11+
/// </summary>
612
public SKConfettiColorCollection()
713
{
814
}
915

16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="SKConfettiColorCollection"/> class with items from the specified collection.
18+
/// </summary>
19+
/// <param name="collection">The collection of colors to add.</param>
1020
public SKConfettiColorCollection(IEnumerable<Color> collection)
1121
: base(collection)
1222
{
1323
}
1424

25+
/// <summary>
26+
/// Initializes a new instance of the <see cref="SKConfettiColorCollection"/> class with the specified initial capacity.
27+
/// </summary>
28+
/// <param name="capacity">The initial capacity.</param>
1529
public SKConfettiColorCollection(int capacity)
1630
: base(capacity)
1731
{

source/SkiaSharp.Extended.UI.Maui/Controls/Confetti/SKConfettiColorCollectionTypeConverter.shared.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
namespace SkiaSharp.Extended.UI.Controls.Converters;
22

3+
/// <summary>
4+
/// Converts comma-separated color strings to <see cref="SKConfettiColorCollection"/> instances.
5+
/// </summary>
36
public class SKConfettiColorCollectionTypeConverter : StringTypeConverter
47
{
8+
/// <inheritdoc/>
59
protected override object? ConvertFromStringCore(string? value)
610
{
711
if (value == null)

source/SkiaSharp.Extended.UI.Maui/Controls/Confetti/SKConfettiEmitter.shared.cs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,32 @@
22

33
namespace SkiaSharp.Extended.UI.Controls
44
{
5+
/// <summary>
6+
/// Controls the rate and duration of particle emission for a confetti system.
7+
/// </summary>
58
public class SKConfettiEmitter : BindableObject
69
{
10+
/// <summary>
11+
/// Identifies the <see cref="ParticleRate"/> bindable property.
12+
/// </summary>
713
public static readonly BindableProperty ParticleRateProperty = BindableProperty.Create(
814
nameof(ParticleRate),
915
typeof(int),
1016
typeof(SKConfettiEmitter),
1117
100);
1218

19+
/// <summary>
20+
/// Identifies the <see cref="MaxParticles"/> bindable property.
21+
/// </summary>
1322
public static readonly BindableProperty MaxParticlesProperty = BindableProperty.Create(
1423
nameof(MaxParticles),
1524
typeof(int),
1625
typeof(SKConfettiEmitter),
1726
-1);
1827

28+
/// <summary>
29+
/// Identifies the <see cref="Duration"/> bindable property.
30+
/// </summary>
1931
public static readonly BindableProperty DurationProperty = BindableProperty.Create(
2032
nameof(Duration),
2133
typeof(double),
@@ -29,16 +41,28 @@ public class SKConfettiEmitter : BindableObject
2941
false,
3042
defaultBindingMode: BindingMode.OneWayToSource);
3143

44+
/// <summary>
45+
/// Identifies the <see cref="IsComplete"/> bindable property.
46+
/// </summary>
3247
public static readonly BindableProperty IsCompleteProperty = IsCompletePropertyKey.BindableProperty;
3348

3449
private int totalParticles = 0;
3550
private double totalDuration = 0;
3651

52+
/// <summary>
53+
/// Initializes a new instance of the <see cref="SKConfettiEmitter"/> class.
54+
/// </summary>
3755
public SKConfettiEmitter()
3856
{
3957
DebugUtils.LogPropertyChanged(this);
4058
}
4159

60+
/// <summary>
61+
/// Initializes a new instance of the <see cref="SKConfettiEmitter"/> class with the specified settings.
62+
/// </summary>
63+
/// <param name="particleRate">The number of particles emitted per second.</param>
64+
/// <param name="maxParticles">The maximum number of particles, or -1 for unlimited.</param>
65+
/// <param name="duration">The emission duration in seconds, 0 for burst, or -1 for infinite.</param>
4266
public SKConfettiEmitter(int particleRate, int maxParticles, double duration)
4367
: this()
4468
{
@@ -47,32 +71,51 @@ public SKConfettiEmitter(int particleRate, int maxParticles, double duration)
4771
Duration = duration;
4872
}
4973

74+
/// <summary>
75+
/// Gets or sets the number of particles emitted per second.
76+
/// </summary>
5077
public int ParticleRate
5178
{
5279
get => (int)GetValue(ParticleRateProperty);
5380
set => SetValue(ParticleRateProperty, value);
5481
}
5582

83+
/// <summary>
84+
/// Gets or sets the maximum total number of particles. Use -1 for unlimited.
85+
/// </summary>
5686
public int MaxParticles
5787
{
5888
get => (int)GetValue(MaxParticlesProperty);
5989
set => SetValue(MaxParticlesProperty, value);
6090
}
6191

92+
/// <summary>
93+
/// Gets or sets the emission duration in seconds. Use 0 for burst mode or -1 for infinite.
94+
/// </summary>
6295
public double Duration
6396
{
6497
get => (double)GetValue(DurationProperty);
6598
set => SetValue(DurationProperty, value);
6699
}
67100

101+
/// <summary>
102+
/// Gets a value indicating whether the emitter has completed emitting particles.
103+
/// </summary>
68104
public bool IsComplete
69105
{
70106
get => (bool)GetValue(IsCompleteProperty);
71107
private set => SetValue(IsCompletePropertyKey, value);
72108
}
73109

110+
/// <summary>
111+
/// Occurs when new particles have been created.
112+
/// </summary>
74113
public event Action<int>? ParticlesCreated;
75114

115+
/// <summary>
116+
/// Updates the emitter state for the given elapsed time.
117+
/// </summary>
118+
/// <param name="deltaTime">The time elapsed since the last update.</param>
76119
public void Update(TimeSpan deltaTime)
77120
{
78121
if (IsComplete)
@@ -103,15 +146,37 @@ public void Update(TimeSpan deltaTime)
103146
(Duration > 0 && totalDuration >= Duration); // reached the max duration
104147
}
105148

149+
/// <summary>
150+
/// Creates a burst emitter that emits all particles at once.
151+
/// </summary>
152+
/// <param name="particles">The number of particles to emit.</param>
153+
/// <returns>A new burst-mode emitter.</returns>
106154
public static SKConfettiEmitter Burst(int particles) =>
107155
new SKConfettiEmitter(particles, -1, 0);
108156

157+
/// <summary>
158+
/// Creates a stream emitter that emits particles over a specified duration.
159+
/// </summary>
160+
/// <param name="particleRate">The number of particles emitted per second.</param>
161+
/// <param name="duration">The emission duration in seconds.</param>
162+
/// <returns>A new stream-mode emitter.</returns>
109163
public static SKConfettiEmitter Stream(int particleRate, double duration) =>
110164
new SKConfettiEmitter(particleRate, -1, duration);
111165

166+
/// <summary>
167+
/// Creates an infinite emitter with no particle limit.
168+
/// </summary>
169+
/// <param name="particleRate">The number of particles emitted per second.</param>
170+
/// <returns>A new infinite emitter.</returns>
112171
public static SKConfettiEmitter Infinite(int particleRate) =>
113172
new SKConfettiEmitter(particleRate, -1, -1);
114173

174+
/// <summary>
175+
/// Creates an infinite emitter with a maximum particle limit.
176+
/// </summary>
177+
/// <param name="particleRate">The number of particles emitted per second.</param>
178+
/// <param name="maxParticles">The maximum total number of particles.</param>
179+
/// <returns>A new infinite emitter with a particle cap.</returns>
115180
public static SKConfettiEmitter Infinite(int particleRate, int maxParticles) =>
116181
new SKConfettiEmitter(particleRate, maxParticles, -1);
117182
}

source/SkiaSharp.Extended.UI.Maui/Controls/Confetti/SKConfettiEmitterBounds.shared.cs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,55 @@
11
namespace SkiaSharp.Extended.UI.Controls;
22

3+
/// <summary>
4+
/// Defines the bounds from which a confetti emitter spawns particles.
5+
/// </summary>
36
[TypeConverter(typeof(Converters.SKConfettiEmitterBoundsTypeConverter))]
47
public readonly struct SKConfettiEmitterBounds
58
{
9+
/// <summary>
10+
/// Initializes a new instance of the <see cref="SKConfettiEmitterBounds"/> struct for the specified side.
11+
/// </summary>
12+
/// <param name="side">The side of the view to emit from.</param>
613
public SKConfettiEmitterBounds(SKConfettiEmitterSide side)
714
: this(Rect.Zero, side)
815
{
916
}
1017

18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="SKConfettiEmitterBounds"/> struct for a specific point.
20+
/// </summary>
21+
/// <param name="x">The x-coordinate of the emission point.</param>
22+
/// <param name="y">The y-coordinate of the emission point.</param>
1123
public SKConfettiEmitterBounds(double x, double y)
1224
: this(new Rect(x, y, 0, 0), SKConfettiEmitterSide.Bounds)
1325
{
1426
}
1527

28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="SKConfettiEmitterBounds"/> struct for a specific point.
30+
/// </summary>
31+
/// <param name="point">The emission point.</param>
1632
public SKConfettiEmitterBounds(Point point)
1733
: this(new Rect(point, Size.Zero), SKConfettiEmitterSide.Bounds)
1834
{
1935
}
2036

37+
/// <summary>
38+
/// Initializes a new instance of the <see cref="SKConfettiEmitterBounds"/> struct for a specific rectangular area.
39+
/// </summary>
40+
/// <param name="x">The x-coordinate of the bounds.</param>
41+
/// <param name="y">The y-coordinate of the bounds.</param>
42+
/// <param name="width">The width of the bounds.</param>
43+
/// <param name="height">The height of the bounds.</param>
2144
public SKConfettiEmitterBounds(double x, double y, double width, double height)
2245
: this(new Rect(x, y, width, height), SKConfettiEmitterSide.Bounds)
2346
{
2447
}
2548

49+
/// <summary>
50+
/// Initializes a new instance of the <see cref="SKConfettiEmitterBounds"/> struct for a specific rectangle.
51+
/// </summary>
52+
/// <param name="rect">The emission bounds rectangle.</param>
2653
public SKConfettiEmitterBounds(Rect rect)
2754
: this(rect, SKConfettiEmitterSide.Bounds)
2855
{
@@ -36,47 +63,104 @@ private SKConfettiEmitterBounds(Rect rect, SKConfettiEmitterSide side)
3663

3764
//
3865

66+
/// <summary>
67+
/// Gets the rectangle defining the emission area.
68+
/// </summary>
3969
public Rect Rect { get; }
4070

71+
/// <summary>
72+
/// Gets the side from which particles are emitted.
73+
/// </summary>
4174
public SKConfettiEmitterSide Side { get; }
4275

4376
//
4477

78+
/// <summary>
79+
/// Converts an <see cref="SKConfettiEmitterSide"/> to an <see cref="SKConfettiEmitterBounds"/>.
80+
/// </summary>
81+
/// <param name="side">The emitter side.</param>
4582
public static implicit operator SKConfettiEmitterBounds(SKConfettiEmitterSide side) =>
4683
new SKConfettiEmitterBounds(side);
4784

85+
/// <summary>
86+
/// Converts a <see cref="Microsoft.Maui.Graphics.Point"/> to an <see cref="SKConfettiEmitterBounds"/>.
87+
/// </summary>
88+
/// <param name="point">The point.</param>
4889
public static implicit operator SKConfettiEmitterBounds(Point point) =>
4990
new SKConfettiEmitterBounds(point);
5091

92+
/// <summary>
93+
/// Converts a <see cref="Microsoft.Maui.Graphics.Rect"/> to an <see cref="SKConfettiEmitterBounds"/>.
94+
/// </summary>
95+
/// <param name="rect">The rectangle.</param>
5196
public static implicit operator SKConfettiEmitterBounds(Rect rect) =>
5297
new SKConfettiEmitterBounds(rect);
5398

5499
//
55100

101+
/// <summary>
102+
/// Gets emitter bounds that emit from the top side of the view.
103+
/// </summary>
56104
public static SKConfettiEmitterBounds Top =>
57105
new SKConfettiEmitterBounds(SKConfettiEmitterSide.Top);
58106

107+
/// <summary>
108+
/// Gets emitter bounds that emit from the left side of the view.
109+
/// </summary>
59110
public static SKConfettiEmitterBounds Left =>
60111
new SKConfettiEmitterBounds(SKConfettiEmitterSide.Left);
61112

113+
/// <summary>
114+
/// Gets emitter bounds that emit from the right side of the view.
115+
/// </summary>
62116
public static SKConfettiEmitterBounds Right =>
63117
new SKConfettiEmitterBounds(SKConfettiEmitterSide.Right);
64118

119+
/// <summary>
120+
/// Gets emitter bounds that emit from the bottom side of the view.
121+
/// </summary>
65122
public static SKConfettiEmitterBounds Bottom =>
66123
new SKConfettiEmitterBounds(SKConfettiEmitterSide.Bottom);
67124

125+
/// <summary>
126+
/// Gets emitter bounds that emit from the center of the view.
127+
/// </summary>
68128
public static SKConfettiEmitterBounds Center =>
69129
new SKConfettiEmitterBounds(SKConfettiEmitterSide.Center);
70130

131+
/// <summary>
132+
/// Creates emitter bounds for a specific rectangular area.
133+
/// </summary>
134+
/// <param name="x">The x-coordinate of the bounds.</param>
135+
/// <param name="y">The y-coordinate of the bounds.</param>
136+
/// <param name="width">The width of the bounds.</param>
137+
/// <param name="height">The height of the bounds.</param>
138+
/// <returns>A new <see cref="SKConfettiEmitterBounds"/> for the specified area.</returns>
71139
public static SKConfettiEmitterBounds Bounds(double x, double y, double width, double height) =>
72140
new SKConfettiEmitterBounds(x, y, width, height);
73141

142+
/// <summary>
143+
/// Creates emitter bounds for a specific rectangle.
144+
/// </summary>
145+
/// <param name="rect">The emission bounds rectangle.</param>
146+
/// <returns>A new <see cref="SKConfettiEmitterBounds"/> for the specified rectangle.</returns>
74147
public static SKConfettiEmitterBounds Bounds(Rect rect) =>
75148
new SKConfettiEmitterBounds(rect);
76149

150+
/// <summary>
151+
/// Creates emitter bounds for a specific point.
152+
/// </summary>
153+
/// <param name="x">The x-coordinate of the emission point.</param>
154+
/// <param name="y">The y-coordinate of the emission point.</param>
155+
/// <returns>A new <see cref="SKConfettiEmitterBounds"/> for the specified point.</returns>
77156
public static SKConfettiEmitterBounds Point(double x, double y) =>
78157
new SKConfettiEmitterBounds(x, y);
79158

159+
/// <summary>
160+
/// Creates emitter bounds for a specific point.
161+
/// </summary>
162+
/// <param name="point">The emission point.</param>
163+
/// <returns>A new <see cref="SKConfettiEmitterBounds"/> for the specified point.</returns>
80164
public static SKConfettiEmitterBounds Point(Point point) =>
81165
new SKConfettiEmitterBounds(point);
82166
}

source/SkiaSharp.Extended.UI.Maui/Controls/Confetti/SKConfettiEmitterBoundsTypeConverter.shared.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
namespace SkiaSharp.Extended.UI.Controls.Converters;
22

3+
/// <summary>
4+
/// Converts string values to <see cref="SKConfettiEmitterBounds"/> instances.
5+
/// </summary>
36
public class SKConfettiEmitterBoundsTypeConverter : StringTypeConverter
47
{
8+
/// <inheritdoc/>
59
protected override object? ConvertFromStringCore(string? value)
610
{
711
if (value == null)

0 commit comments

Comments
 (0)