Skip to content

Commit 072bce7

Browse files
committed
Update headers, docs, and add IsNullOrEmpty for arrays
Updated file headers for consistency and correct dates. Clarified XML docs for AsMemento in Action extensions. Added IsNullOrEmpty extension for nullable arrays and improved array extension documentation. Renamed IBinaryInteger extension file header for accuracy.
1 parent 28784c5 commit 072bce7

3 files changed

Lines changed: 28 additions & 6 deletions

File tree

Arkane.Core/Extensions/ExtensionMethods-System-Action.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// Copyright Arkane Systems 2012-2026. All rights reserved.
99
//
10-
// Created: 2026-04-06 9:27 AM
10+
// Created: 2026-04-07 10:27 PM
1111

1212
#endregion
1313

@@ -37,10 +37,13 @@ public static partial class ExtensionMethods
3737
extension (Action @this)
3838
{
3939
/// <summary>
40-
/// Creates an <see cref="IDisposable" /> that will execute the specified <see cref="Action" /> when it is
40+
/// Creates an <see cref="IDisposable" /> <see cref="T:ArkaneSystems.Arkane.Memento" /> that will execute the specified
41+
/// <see cref="Action" /> when it is
4142
/// disposed.
4243
/// </summary>
43-
/// <returns>An <see cref="IDisposable" /> implemented by a <see cref="T:ArkaneSystems.Arkane.Memento" />.</returns>
44+
/// <returns>
45+
/// An <see cref="IDisposable" /> implemented by a <see cref="T:ArkaneSystems.Arkane.Memento" />.
46+
/// </returns>
4447
[PublicAPI]
4548
public IDisposable AsMemento () => new Memento (@this);
4649

Arkane.Core/Extensions/ExtensionMethods-System-Array.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// Copyright Arkane Systems 2012-2026. All rights reserved.
99
//
10-
// Created: 2026-04-06 6:26 PM
10+
// Created: 2026-04-07 10:31 AM
1111

1212
#endregion
1313

@@ -29,6 +29,11 @@ public static partial class ExtensionMethods
2929
{
3030
#region Nested type: $extension
3131

32+
/// <summary>
33+
/// Extension methods for <see cref="Array" />. Note that these are not extension methods for
34+
/// <see cref="System.Array" />, but rather for any array type, such as <c>int[]</c>, <c>string[,]</c>, etc.
35+
/// </summary>
36+
/// <param name="this">The array instance.</param>
3237
extension (Array @this)
3338
{
3439
/// <summary>
@@ -57,5 +62,19 @@ public Type GetElementType ()
5762
}
5863
}
5964

65+
/// <summary>
66+
/// Extension methods for nullable array types.
67+
/// </summary>
68+
/// <param name="this"></param>
69+
extension (Array? @this)
70+
{
71+
/// <summary>
72+
/// Determines whether the specified array is null or has a length of zero.
73+
/// </summary>
74+
/// <returns>true if the array is null or empty; otherwise, false.</returns>
75+
[PublicAPI]
76+
public bool IsNullOrEmpty () => (@this == null) || (@this.Length == 0);
77+
}
78+
6079
#endregion
6180
}

Arkane.Core/Extensions/ExtensionMethods-System-Numerics-IBinaryInteger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#region header
22

3-
// Arkane.Core - ExtensionMethods-System-IBinaryInteger.cs
3+
// Arkane.Core - ExtensionMethods-System-Numerics-IBinaryInteger.cs
44
//
55
// Alistair J. R. Young
66
// Arkane Systems
77
//
88
// Copyright Arkane Systems 2012-2026. All rights reserved.
99
//
10-
// Created: 2026-04-05 11:04 PM
10+
// Created: 2026-04-07 10:31 AM
1111

1212
#endregion
1313

0 commit comments

Comments
 (0)