Binder Class
TOC
Collapse the table of content
Expand the table of content

Binder Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type.

System::Object
  System.Reflection::Binder

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

No code example is currently available or this language may not be supported.

The Binder type exposes the following members.

  NameDescription
Protected methodBinderInitializes a new instance of the Binder class.
Top

  NameDescription
Public methodBindToFieldSelects a field from the given set of fields, based on the specified criteria.
Public methodBindToMethodSelects a method to invoke from the given set of methods, based on the supplied arguments.
Public methodChangeTypeChanges the type of the given Object to the given Type.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReorderArgumentArrayUpon returning from BindToMethod, restores the args argument to what it was when it came from BindToMethod.
Public methodSelectMethodSelects a method from the given set of methods, based on the argument type.
Public methodSelectPropertySelects a property from the given set of properties, based on the specified criteria.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Implementations of the Binder class are used by methods such as Type::InvokeMember, which selects from a set of possible members to execute, based on a set of parameter types and argument values; Type::GetMethod, which selects a method based on parameter types; and so on.

A default implementation of the Binder class is provided by the Type::DefaultBinder property.

Notes to Inheritors

When you inherit from Binder, you must override the following members: BindToMethod, BindToField, ReorderArgumentArray, SelectMethod, SelectProperty, and ChangeType.

The following example implements and demonstrates all members of the Binder class. The private method CanConvertFrom finds compatible types for a given type.

No code example is currently available or this language may not be supported.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2017 Microsoft