Class ReflectionExtensions
- Namespace
- Icy.Data
- Assembly
- IcyUI.dll
Provides extensions for the reflection purposes.
public static class ReflectionExtensions
- Inheritance
-
ReflectionExtensions
- Inherited Members
Properties
ConverterInstance
Gets or sets an instance of the ITypeConverter for some conversions.
public static ITypeConverter? ConverterInstance { get; set; }
Property Value
Methods
GetIndexer(Type, string[], out object?[])
Gets the indexer definition for the specified type according to the specified indexer arguments.
public static PropertyInfo GetIndexer(this Type targetType, string[] arguments, out object?[] convertedArguments)
Parameters
targetTypeTypeThe target type to get indexer definition.
argumentsstring[]The argument string array to search indexer.
convertedArgumentsobject[]The result of the arguments conversion.
Returns
- PropertyInfo
The indexer definition that supports the provided arguments.
Remarks
The indexer arguments should be literal expressions that are available to parse for any of the indexers of the specified type.
Exceptions
- ArgumentException
Occurs when there are no indexers for the specified arguments.
- AmbiguousMatchException
Occurs when there are more than one indexer for the specified arguments.
IgnoreNullableDefinition(Type)
Gets the type info without the Nullable<T> definition.
public static Type IgnoreNullableDefinition(this Type type)
Parameters
typeTypeThe type to get non-nullable definition.
Returns
- Type
The type itself if it is not Nullable<T>; underlying type otherwise.
IsNullable(Type)
Gets a value that determines whether the type is Nullable<T>.
public static bool IsNullable(this Type type)
Parameters
typeTypeThe type to check.
Returns
- bool
true if the type is Nullable<T>; otherwise false.