DotNext.Reflection by Roman Sakno

<PackageReference Include="DotNext.Reflection" Version="0.5.0" />

 Type<T>

public static class Type<T>
Provides typed access to class or value type metadata.
public static class Attribute<T, A> where A : Attribute

Provides typed access to the type attribute.

public static class Constructor<T>

Provides access to constructor of type T without parameters.

public static class Constructor<T, P>

Provides access to constructor of type T with single parameter.

public static class Constructor<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>

Provides access to constructor of type T with nine parameters.

public static class Constructor<T, P1, P2>

Provides access to constructor of type T with two parameters.

public static class Constructor<T, P1, P2, P3>

Provides access to constructor of type T with three parameters.

public static class Constructor<T, P1, P2, P3, P4>

Provides access to constructor of type T with four parameters.

public static class Constructor<T, P1, P2, P3, P4, P5>

Provides access to constructor of type T with five parameters.

public static class Constructor<T, P1, P2, P3, P4, P5, P6>

Provides access to constructor of type T with six parameters.

public static class Constructor<T, P1, P2, P3, P4, P5, P6, P7>

Provides access to constructor of type T with seven parameters.

public static class Constructor<T, P1, P2, P3, P4, P5, P6, P7, P8>

Provides access to constructor of type T with eight parameters.

public static class Constructor<T, P1, P2, P3, P4, P5, P6, P7, P8, P9>

Provides access to constructor of type T with nine parameters.

public static class Event<T, H> where H : MulticastDelegate

Provides typed access to instance event declared in type T.

public static class Field<T, V>

Provides typed access to instance field declared in type T.

public static class Indexer<T, A, V> where A : struct

Provides access to indexer property declared in type T.

public static class Method<T>

Provides access to methods declared in type T.

public static class Method<T, P>

Provides access to methods with single parameter declared in type T.

public static class Method<T, P1, P2>

Provides access to methods with two parameters declared in type T.

public static class Method<T, P1, P2, P3>

Provides access to methods with three parameters declared in type T.

public static class Method<T, P1, P2, P3, P4>

Provides access to methods with four parameters declared in type T.

public static class Method<T, P1, P2, P3, P4, P5>

Provides access to methods with five parameters declared in type T.

public static class Method<T, P1, P2, P3, P4, P5, P6>

Provides access to methods with six parameters declared in type T.

public static class Operator<T>

Represents unary operator applicable to type T.

public static class Operator<T, U>

Represents binary operator applicable to type T.

public static class Property<T, V>

Provides access to property declared in type T.

public static readonly Operator<T, T, bool> Equals

Provides smart equality check.

public static readonly Operator<T, int> GetHashCode

Provides smart hash code computation.

public static readonly Predicate<T> IsDefault

Checks whether the specified value is default value.

public static T Default { get; }

Returns default value for this type.

public static Type RuntimeType { get; }

Gets reflected type.

public static void Concept(Type conceptType)

Applies a concept represented by static class to type T.

public static C Concept<C>() where C : IConcept<T>

Applies a concept to type T.

public static T Convert<U>(U value)

Converts object into type T.

public static Constructor<Function<A, T>> GetConstructor<A>(bool nonPublic = false) where A : struct

Reflects constructor as function.

public static Method<Function<T, A, R>> GetMethod<A, R>(string methodName, bool nonPublic = false) where A : struct

Reflects instance method declared in type T which returns value of type R and has arguments described by type A.

public static Method<Procedure<T, A>> GetMethod<A>(string methodName, bool nonPublic = false) where A : struct

Reflects instance method declared in type T without return value and has arguments described by type A.

public static Method<Function<A, R>> GetStaticMethod<A, R>(string methodName, bool nonPublic = false) where A : struct

Reflects static method declared in type T which returns value of type R and has arguments described by type A.

public static Method<Procedure<A>> GetStaticMethod<A>(string methodName, bool nonPublic = false) where A : struct

Reflects static method declared in type T without return value and has arguments described by type A.

public static void Initialize()

Calls static constructor of type T.

public static bool IsAssignableFrom<U>()

Determines whether an instance of a specified type can be assigned to an instance of the current type.

public static bool IsAssignableTo<U>()

Determines whether an instance of the current type can be assigned to an instance of the specified type.

public static Constructor<Function<A, T>> RequireConstructor<A>(bool nonPublic = false) where A : struct

Reflects constructor as function.

public static Method<Function<T, A, R>> RequireMethod<A, R>(string methodName, bool nonPublic = false) where A : struct

Reflects instance method declared in type T which returns value of type R and has arguments described by type A.

public static Method<Procedure<T, A>> RequireMethod<A>(string methodName, bool nonPublic = false) where A : struct

Reflects instance method declared in type T without return value and has arguments described by type A.

public static Method<Function<A, R>> RequireStaticMethod<A, R>(string methodName, bool nonPublic = false) where A : struct

Reflects static method declared in type T which returns value of type R and has arguments described by type A.

public static Method<Procedure<A>> RequireStaticMethod<A>(string methodName, bool nonPublic = false) where A : struct

Reflects static method declared in type T without return value and has arguments described by type A.

public static Optional<T> TryConvert<U>(U value)

Applies type cast to the given object respecting overloaded cast operator.

public static bool TryConvert<U>(U value, out T result)

Applies type cast to the given object respecting overloaded cast operator.