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.
struct System.​Reflection.​IReflect
Assembly: System.Runtime
Interoperates with the IDispatch interface.
Properties
public
Type
UnderlyingSystemType
Gets the underlying type that represents the <see cref="T:System.Reflection.IReflect" /> object.
Methods
public
FieldInfo
GetField​(string name,
BindingFlags bindingAttr)
name
The name of the field to find.
bindingAttr
The binding attributes used to control the search.
Returns A <see cref="T:System.Reflection.FieldInfo" /> object containing the field information for the named object that meets the search constraints specified in <paramref name="bindingAttr" /> .
Returns the <see cref="T:System.Reflection.FieldInfo" /> object that corresponds to the specified field and binding flag.
public
FieldInfo[]
GetFields​(BindingFlags bindingAttr)
bindingAttr
The binding attributes used to control the search.
Returns An array of <see cref="T:System.Reflection.FieldInfo" /> objects containing all the field information for this reflection object that meets the search constraints specified in <paramref name="bindingAttr" /> .
Returns an array of <see cref="T:System.Reflection.FieldInfo" /> objects that correspond to all fields of the current class.
public
MemberInfo[]
GetMember​(string name,
BindingFlags bindingAttr)
name
The name of the member to find.
bindingAttr
The binding attributes used to control the search.
Returns An array of <see cref="T:System.Reflection.MemberInfo" /> objects matching the <paramref name="name" /> parameter.
Retrieves an array of <see cref="T:System.Reflection.MemberInfo" /> objects corresponding to all public members or to all members that match a specified name.
public
MemberInfo[]
GetMembers​(BindingFlags bindingAttr)
bindingAttr
The binding attributes used to control the search.
Returns An array of <see cref="T:System.Reflection.MemberInfo" /> objects containing all the member information for this reflection object.
Retrieves an array of <see cref="T:System.Reflection.MemberInfo" /> objects that correspond either to all public members or to all members of the current class.
public
MethodInfo
GetMethod​(string name,
BindingFlags bindingAttr)
name
The name of the member to find.
bindingAttr
The binding attributes used to control the search.
Returns A <see cref="T:System.Reflection.MethodInfo" /> object containing the method information, with the match being based on the method name and search constraints specified in <paramref name="bindingAttr" /> .
Retrieves a <see cref="T:System.Reflection.MethodInfo" /> object that corresponds to a specified method under specified search constraints.
public
MethodInfo
GetMethod​(string name,
BindingFlags bindingAttr,
Binder binder,
Type[] types,
ParameterModifier[] modifiers)
name
The name of the member to find.
bindingAttr
The binding attributes used to control the search.
binder
An object that implements <see cref="T:System.Reflection.Binder" /> , containing properties related to this method.
types
An array used to choose among overloaded methods.
modifiers
An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.
Returns The requested method that matches all the specified parameters.
Retrieves a <see cref="T:System.Reflection.MethodInfo" /> object corresponding to a specified method, using a <see cref="T:System.Type" /> array to choose from among overloaded methods.
public
MethodInfo[]
GetMethods​(BindingFlags bindingAttr)
bindingAttr
The binding attributes used to control the search.
Returns An array of <see cref="T:System.Reflection.MethodInfo" /> objects containing all the methods defined for this reflection object that meet the search constraints specified in <paramref name="bindingAttr" /> .
Retrieves an array of <see cref="T:System.Reflection.MethodInfo" /> objects with all public methods or all methods of the current class.
public
PropertyInfo[]
GetProperties​(BindingFlags bindingAttr)
bindingAttr
The binding attribute used to control the search.
Returns An array of <see cref="T:System.Reflection.PropertyInfo" /> objects for all the properties defined on the reflection object.
Retrieves an array of <see cref="T:System.Reflection.PropertyInfo" /> objects corresponding to all public properties or to all properties of the current class.
public
PropertyInfo
GetProperty​(string name,
BindingFlags bindingAttr)
name
The name of the property to find.
bindingAttr
The binding attributes used to control the search.
Returns A <see cref="T:System.Reflection.PropertyInfo" /> object for the located property that meets the search constraints specified in <paramref name="bindingAttr" /> , or <see langword="null" /> if the property was not located.
Retrieves a <see cref="T:System.Reflection.PropertyInfo" /> object corresponding to a specified property under specified search constraints.
public
PropertyInfo
GetProperty​(string name,
BindingFlags bindingAttr,
Binder binder,
Type returnType,
Type[] types,
ParameterModifier[] modifiers)
name
The name of the member to find.
bindingAttr
The binding attribute used to control the search.
binder
An object that implements <see cref="T:System.Reflection.Binder" /> , containing properties related to this method.
returnType
The type of the property.
types
An array used to choose among overloaded methods with the same name.
modifiers
An array used to choose the parameter modifiers.
Returns A <see cref="T:System.Reflection.PropertyInfo" /> object for the located property, if a property with the specified name was located in this reflection object, or <see langword="null" /> if the property was not located.
Retrieves a <see cref="T:System.Reflection.PropertyInfo" /> object that corresponds to a specified property with specified search constraints.
public
object
InvokeMember​(string name,
BindingFlags invokeAttr,
Binder binder,
object target,
object[] args,
ParameterModifier[] modifiers,
Globalization.CultureInfo culture,
string[] namedParameters)
name
The name of the member to find.
invokeAttr
One of the <see cref="T:System.Reflection.BindingFlags" /> invocation attributes. The <paramref name="invokeAttr" /> parameter may be a constructor, method, property, or field. A suitable invocation attribute must be specified. Invoke the default member of a class by passing the empty string ("") as the name of the member.
binder
One of the <see cref="T:System.Reflection.BindingFlags" /> bit flags. Implements <see cref="T:System.Reflection.Binder" /> , containing properties related to this method.
target
The object on which to invoke the specified member. This parameter is ignored for static members.
args
An array of objects that contains the number, order, and type of the parameters of the member to be invoked. This is an empty array if there are no parameters.
modifiers
An array of <see cref="T:System.Reflection.ParameterModifier" /> objects. This array has the same length as the <paramref name="args" /> parameter, representing the invoked member's argument attributes in the metadata. A parameter can have the following attributes: <see langword="pdIn" /> , <see langword="pdOut" /> , <see langword="pdRetval" /> , <see langword="pdOptional" /> , and <see langword="pdHasDefault" /> . These represent [In], [Out], [retval], [optional], and a default parameter, respectively. These attributes are used by various interoperability services.
culture
An instance of <see cref="T:System.Globalization.CultureInfo" /> used to govern the coercion of types. For example, <paramref name="culture" /> converts a string that represents 1000 to a <see cref="T:System.Double" /> value, since 1000 is represented differently by different cultures. If this parameter is <see langword="null" /> , the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used.
namedParameters
A string array of parameters.
Returns The specified member.
Invokes a specified member.