Class Utils
Extension methods and more...
Namespace: Evergine.Common.Helpers
Assembly: Evergine.Common.dll
Syntax
public static class Utils
Methods
CompareTo<T>(T[], T[])
Compares an array with another array.
Declaration
public static bool CompareTo<T>(this T[] array1, T[] array2) where T : IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
T[] | array1 | Specifies the first array. |
T[] | array2 | Specifies the second array. |
Returns
Type | Description |
---|---|
bool | True if the first array and the second array are equal; otherwise, false. |
Type Parameters
Name | Description |
---|---|
T | The array type. |
DisposeAndNull<T>(ref T)
Safely disposes of a reference if it is not null and sets it to null after disposal.
Declaration
public static void DisposeAndNull<T>(ref T disposable) where T : class, IDisposable
Parameters
Type | Name | Description |
---|---|---|
T | disposable | The object to dispose of. |
Type Parameters
Name | Description |
---|---|
T | The type of object to dispose of. |
Remarks
The reference will be set to null after disposal.