Export (0) Print
Expand All

Binder Class

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)

[<AbstractClass>]
[<SerializableAttribute>]
[<ClassInterfaceAttribute(ClassInterfaceType.AutoDual)>]
[<ComVisibleAttribute(true)>]
type Binder =  class end

The Binder type exposes the following members.

  NameDescription
Protected methodSupported by the XNA FrameworkBinderInitializes a new instance of the Binder class.
Top

  NameDescription
Public methodSupported by the XNA FrameworkBindToFieldSelects a field from the given set of fields, based on the specified criteria.
Public methodSupported by the XNA FrameworkBindToMethodSelects a method to invoke from the given set of methods, based on the supplied arguments.
Public methodSupported by the XNA FrameworkChangeTypeChanges the type of the given Object to the given Type.
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by the XNA FrameworkReorderArgumentArrayUpon returning from BindToMethod, restores the args argument to what it was when it came from BindToMethod.
Public methodSupported by the XNA FrameworkSelectMethodSelects a method from the given set of methods, based on the argument type.
Public methodSupported by the XNA FrameworkSelectPropertySelects a property from the given set of properties, based on the specified criteria.
Public methodSupported by the XNA FrameworkToStringReturns 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.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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

Community Additions

ADD
Show:
© 2015 Microsoft