Skip to content

Commit 9a76f55

Browse files
committed
[C#] Add documentation for Interfaces/Attributes
1 parent 2753d33 commit 9a76f55

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/GodotClassNameAttribute.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.ComponentModel;
23

34
namespace Godot
45
{
@@ -8,14 +9,18 @@ namespace Godot
89
/// the name associated with the class. If the attribute is not present,
910
/// the C# class name can be used instead.
1011
/// </summary>
11-
[AttributeUsage(AttributeTargets.Class)]
12+
[AttributeUsage(AttributeTargets.Class), EditorBrowsable(EditorBrowsableState.Never)]
1213
public class GodotClassNameAttribute : Attribute
1314
{
1415
/// <summary>
1516
/// Original engine class name.
1617
/// </summary>
1718
public string Name { get; }
1819

20+
/// <summary>
21+
/// Specify the name that represents the original engine class.
22+
/// </summary>
23+
/// <param name="name">Name of the original engine class.</param>
1924
public GodotClassNameAttribute(string name)
2025
{
2126
Name = name;

modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/SignalAttribute.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace Godot
44
{
5+
/// <summary>
6+
/// Declares a <see langword="delegate"/> as a signal. This allows any connected
7+
/// <see cref="Callable"/> (and, by extension, their respective objects) to listen and react
8+
/// to events, without directly referencing one another.
9+
/// </summary>
510
[AttributeUsage(AttributeTargets.Delegate)]
611
public sealed class SignalAttribute : Attribute { }
712
}

modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ToolAttribute.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Godot
44
{
5+
/// <summary>
6+
/// Allows the annotated class to execute in the editor.
7+
/// </summary>
58
[AttributeUsage(AttributeTargets.Class)]
69
public sealed class ToolAttribute : Attribute { }
710
}

modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaitable.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ namespace Godot
55
/// </summary>
66
public interface IAwaitable
77
{
8+
/// <summary>
9+
/// Gets an Awaiter for this <see cref="IAwaitable"/>.
10+
/// </summary>
11+
/// <returns>An Awaiter.</returns>
812
IAwaiter GetAwaiter();
913
}
1014

@@ -14,6 +18,10 @@ public interface IAwaitable
1418
/// <typeparam name="TResult">A reference to the result to be passed out.</typeparam>
1519
public interface IAwaitable<out TResult>
1620
{
21+
/// <summary>
22+
/// Gets an Awaiter for this <see cref="IAwaitable{TResult}"/>.
23+
/// </summary>
24+
/// <returns>An Awaiter.</returns>
1725
IAwaiter<TResult> GetAwaiter();
1826
}
1927
}

modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaiter.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ namespace Godot
77
/// </summary>
88
public interface IAwaiter : INotifyCompletion
99
{
10+
/// <summary>
11+
/// The completion status of this <see cref="IAwaiter"/>.
12+
/// </summary>
1013
bool IsCompleted { get; }
1114

15+
/// <summary>
16+
/// Gets the result of completion for this <see cref="IAwaiter"/>.
17+
/// </summary>
1218
void GetResult();
1319
}
1420

@@ -18,8 +24,14 @@ public interface IAwaiter : INotifyCompletion
1824
/// <typeparam name="TResult">A reference to the result to be passed out.</typeparam>
1925
public interface IAwaiter<out TResult> : INotifyCompletion
2026
{
27+
/// <summary>
28+
/// The completion status of this <see cref="IAwaiter{TResult}"/>.
29+
/// </summary>
2130
bool IsCompleted { get; }
2231

32+
/// <summary>
33+
/// Gets the result of completion for this <see cref="IAwaiter{TResult}"/>.
34+
/// </summary>
2335
TResult GetResult();
2436
}
2537
}

0 commit comments

Comments
 (0)