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)
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.
Returns The matching field.
Selects a field from the given set of fields, based on the specified criteria.
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)
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.
Returns An object that contains the given value as the new type.
Changes the type of the given <see langword="Object" /> to the given <see langword="Type" /> .
public
MethodBase
SelectMethod​(BindingFlags bindingAttr,
MethodBase[] match,
Type[] types,
ParameterModifier[] modifiers)
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.
Returns The matching method, if found; otherwise, <see langword="null" /> .
Selects a method from the given set of methods, based on the argument type.
public
PropertyInfo
SelectProperty​(BindingFlags bindingAttr,
PropertyInfo[] match,
Type returnType,
Type[] indexes,
ParameterModifier[] modifiers)
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.
Returns The matching property.
Selects a property from the given set of properties, based on the specified criteria.
public
bool
Equals​(object obj)
Inherited from object
obj
The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to 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
Returns A hash code for the current object.
Serves as the default hash function.
public
Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates 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.