Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Reflection.​RuntimeReflectionExtensions
Assembly: System.Runtime
Inheritance: object → RuntimeReflectionExtensions
Provides methods that retrieve information about types at run time.
Methods
public static
MethodInfo
GetMethodInfo​(delegate del)
Gets an object that represents the method represented by the specified delegate.
Returns An object that represents the method.
del
The delegate to examine.
public static
MethodInfo
GetRuntimeBaseDefinition​(MethodInfo method)
Retrieves an object that represents the specified method on the direct or indirect base class where the method was first declared.
Returns An object that represents the specified method's initial declaration on a base class.
method
The method to retrieve information about.
public static
EventInfo
GetRuntimeEvent​(Type type,
string name)
Retrieves an object that represents the specified event.
Returns An object that represents the specified event, or <see langword="null" /> if the event is not found.
type
The type that contains the event.
name
The name of the event.
public static
Collections.​Generic.​IEnumerable<​EventInfo>
GetRuntimeEvents​(Type type)
Retrieves a collection that represents all the events defined on a specified type.
Returns A collection of events for the specified type.
type
The type that contains the events.
public static
FieldInfo
GetRuntimeField​(Type type,
string name)
Retrieves an object that represents a specified field.
Returns An object that represents the specified field, or <see langword="null" /> if the field is not found.
type
The type that contains the field.
name
The name of the field.
public static
Collections.​Generic.​IEnumerable<​FieldInfo>
GetRuntimeFields​(Type type)
Retrieves a collection that represents all the fields defined on a specified type.
Returns A collection of fields for the specified type.
type
The type that contains the fields.
public static
InterfaceMapping
GetRuntimeInterfaceMap​(TypeInfo typeInfo,
Type interfaceType)
Returns an interface mapping for the specified type and the specified interface.
Returns An object that represents the interface mapping for the specified interface and type.
typeInfo
The type to retrieve a mapping for.
interfaceType
The interface to retrieve a mapping for.
public static
MethodInfo
GetRuntimeMethod​(Type type,
string name,
Type[] parameters)
Retrieves an object that represents a specified method.
Returns An object that represents the specified method, or <see langword="null" /> if the method is not found.
type
The type that contains the method.
name
The name of the method.
parameters
An array that contains the method's parameters.
public static
Collections.​Generic.​IEnumerable<​MethodInfo>
GetRuntimeMethods​(Type type)
Retrieves a collection that represents all methods defined on a specified type.
Returns A collection of methods for the specified type.
type
The type that contains the methods.
public static
Collections.​Generic.​IEnumerable<​PropertyInfo>
GetRuntimeProperties​(Type type)
Retrieves a collection that represents all the properties defined on a specified type.
Returns A collection of properties for the specified type.
type
The type that contains the properties.
public static
PropertyInfo
GetRuntimeProperty​(Type type,
string name)
Retrieves an object that represents a specified property.
Returns An object that represents the specified property, or <see langword="null" /> if the property is not found.
type
The type that contains the property.
name
The name of the property.
public
bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj
The object to compare with the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.