Class SystemExtensions
Inheritance
SystemExtensions
Assembly: Glitch9.dll
Syntax
public static class SystemExtensions
Methods
|
Edit this page
View Source
GetAllTypes(Assembly)
Gets all types from the given assembly, even if some types fail to load.
If a ReflectionTypeLoadException occurs, returns only the successfully loaded types.
Declaration
public static Type[] GetAllTypes(this Assembly assembly)
Parameters
| Type |
Name |
Description |
| Assembly |
assembly |
The assembly to retrieve types from.
|
Returns
| Type |
Description |
| Type[] |
An array of all successfully loaded types from the assembly.
|
|
Edit this page
View Source
GetHashCodeOrDefault(string)
Declaration
public static int GetHashCodeOrDefault(this string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
Returns
|
Edit this page
View Source
GetHashCodeOrDefault<T>(IList<T>)
Declaration
public static int GetHashCodeOrDefault<T>(this IList<T> list)
Parameters
| Type |
Name |
Description |
| IList<T> |
list |
|
Returns
Type Parameters
|
Edit this page
View Source
GetHashCodeOrDefault<T>(T?)
Declaration
public static int GetHashCodeOrDefault<T>(this T? value) where T : struct
Parameters
| Type |
Name |
Description |
| T? |
value |
|
Returns
Type Parameters
|
Edit this page
View Source
GetHashCodeOrDefault<T>(T)
Declaration
public static int GetHashCodeOrDefault<T>(this T value) where T : struct
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Type Parameters
|
Edit this page
View Source
GetName(object)
Declaration
public static string GetName(this object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
|
Edit this page
View Source
HasInterface<TInterface>(Type)
Checks if the type implements the specified interface TInterface.
Declaration
public static bool HasInterface<TInterface>(this Type type)
Parameters
| Type |
Name |
Description |
| Type |
type |
The type to inspect.
|
Returns
| Type |
Description |
| bool |
True if the type implements the interface; otherwise, false.
|
Type Parameters
| Name |
Description |
| TInterface |
The interface type to check for.
|
|
Edit this page
View Source
IsSubclassOfRawGeneric(Type, Type)
Determines whether the given type is a subclass of the specified generic type definition.
Declaration
public static bool IsSubclassOfRawGeneric(this Type toCheck, Type generic)
Parameters
| Type |
Name |
Description |
| Type |
toCheck |
The type to check.
|
| Type |
generic |
The generic type definition to compare against.
|
Returns
| Type |
Description |
| bool |
True if toCheck is a subclass of generic; otherwise, false.
|
|
Edit this page
View Source
TryDispose(IDisposable)
Declaration
public static void TryDispose(this IDisposable disposable)
Parameters
|
Edit this page
View Source
UpcastArray<TIn, TOut>(TIn[])
Upcasts an array of type TIn to an array of type TOut.
Declaration
public static TOut[] UpcastArray<TIn, TOut>(this TIn[] assets) where TIn : TOut
Parameters
| Type |
Name |
Description |
| TIn[] |
assets |
Array to upcast.
|
Returns
| Type |
Description |
| TOut[] |
Upcasted array, or null if input is null or empty.
|
Type Parameters
| Name |
Description |
| TIn |
Input type (must inherit from TOut).
|
| TOut |
Output type (base type).
|