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.​Binder
Assembly: System.Runtime
Inheritance: object → Binder
Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type.
Methods
public
FieldInfo
BindToField​(BindingFlags bindingAttr,
FieldInfo[] match,
object value,
Globalization.​CultureInfo? culture)
Selects a field from the given set of fields, based on the specified criteria.
Returns The matching field.
bindingAttr
A bitwise combination of <see cref="T:System.Reflection.BindingFlags" /> values.
match
The set of fields that are candidates for matching. For example, when a <see cref="T:System.Reflection.Binder" /> object is used by <see cref="Overload:System.Type.InvokeMember" /> , this parameter specifies the set of fields that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by <see cref="P:System.Type.DefaultBinder" /> changes the order of this array.
value
The field value used to locate a matching field.
culture
An instance of <see cref="T:System.Globalization.CultureInfo" /> that is used to control the coercion of data types, in binder implementations that coerce types. If <paramref name="culture" /> is <see langword="null" /> , the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used.
public
MethodBase
BindToMethod​(BindingFlags bindingAttr,
MethodBase[] match,
Object[]& args,
ParameterModifier[] modifiers,
Globalization.​CultureInfo culture,
string[] names,
Object& state)
public
object
ChangeType​(object value,
Type type,
Globalization.​CultureInfo? culture)
Changes the type of the given <see langword="Object" /> to the given <see langword="Type" /> .
Returns An object that contains the given value as the new type.
value
The object to change into a new <see langword="Type" /> .
type
The new <see langword="Type" /> that <paramref name="value" /> will become.
culture
An instance of <see cref="T:System.Globalization.CultureInfo" /> that is used to control the coercion of data types. If <paramref name="culture" /> is <see langword="null" /> , the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used.
public
MethodBase
SelectMethod​(BindingFlags bindingAttr,
MethodBase[] match,
Type[] types,
ParameterModifier[] modifiers)
Selects a method from the given set of methods, based on the argument type.
Returns The matching method, if found; otherwise, <see langword="null" /> .
bindingAttr
A bitwise combination of <see cref="T:System.Reflection.BindingFlags" /> values.
match
The set of methods that are candidates for matching. For example, when a <see cref="T:System.Reflection.Binder" /> object is used by <see cref="Overload:System.Type.InvokeMember" /> , this parameter specifies the set of methods that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by <see cref="P:System.Type.DefaultBinder" /> changes the order of this array.
types
The parameter types used to locate a matching method.
modifiers
An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified.
public
PropertyInfo
SelectProperty​(BindingFlags bindingAttr,
PropertyInfo[] match,
Type returnType,
Type[] indexes,
ParameterModifier[] modifiers)
Selects a property from the given set of properties, based on the specified criteria.
Returns The matching property.
bindingAttr
A bitwise combination of <see cref="T:System.Reflection.BindingFlags" /> values.
match
The set of properties that are candidates for matching. For example, when a <see cref="T:System.Reflection.Binder" /> object is used by <see cref="Overload:System.Type.InvokeMember" /> , this parameter specifies the set of properties that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by <see cref="P:System.Type.DefaultBinder" /> changes the order of this array.
returnType
The return value the matching property must have.
indexes
The index types of the property being searched for. Used for index properties such as the indexer for a class.
modifiers
An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified.
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.