Types Class
Provides utility methods for type reflection and manipulation, particularly for types used in Oxbind.
public static class Types
- Inheritance
-
Types
Properties
IEnumerable |
Gets the type of IEnumerable<T>. |
Bind |
Gets the type of BindResult<T>. |
Bind |
Gets the type of BindResultImpl<T>. |
String |
Gets the type of string. |
Void |
Gets the type of void. |
Bind |
Gets the type of BindResult<T> ( |
Methods
Get |
Retrieves the constructor of the specified class that is not annotated with the IgnoredAttribute. |
First |
Gets the type of the first type parameter of the specified generic type. |
Is |
Gets whether the raw type of the specified type is equal to the specified expected type. |
Properties Detail
IEnumerableT
Gets the type of IEnumerable<T>.
public static Type IEnumerableT { get; }
Property Value
BindResultT
Gets the type of BindResult<T>.
public static Type BindResultT { get; }
Property Value
BindResultImplT
Gets the type of BindResultImpl<T>.
public static Type BindResultImplT { get; }
Property Value
String
Gets the type of string.
public static Type String { get; }
Property Value
Void
Gets the type of void.
public static Type Void { get; }
Property Value
BindResultString
Gets the type of BindResult<T> (T
is
string
).
public static Type BindResultString { get; }
Property Value
Methods Detail
GetConstructor(Type)
Retrieves the constructor of the specified class that is not annotated with the IgnoredAttribute.
public static ConstructorInfo GetConstructor(Type clazz)
Parameters
- clazz
- Type
The type of the class whose constructor is to be retrieved.
Returns
The ConstructorInfo of the constructor that is not
annotated with the IgnoredAttribute, or null
if no
such constructor exists.
FirstInnerType(Type)
Gets the type of the first type parameter of the specified generic type.
public static Type FirstInnerType(Type t)
Parameters
- t
- Type
The generic type.
Returns
The type of the first type parameter.
IsRawType(Type, Type)
Gets whether the raw type of the specified type is equal to the specified expected type.
public static bool IsRawType(Type type, Type expectedType)
Parameters
- type
- Type
The generic type.
- expectedType
- Type
The expected open generic type (e.g.,
typeof(IEnumerable<>)
).
Returns
true
if type
is a generic type and if its
generic type definition equals expectedType
, or if
type
is not a generic type and it equals expectedType
; otherwise, false
.