C# Class Monobjc.Utils.ImplicitMethodBinder

Binder to select the appropriate method for implicit conversion.
Inheritance: System.Reflection.Binder
Exibir arquivo Open project: Monobjc/monobjc Class Usage Examples

Public Methods

Method Description
BindToField ( BindingFlags bindingAttr, FieldInfo match, object value, CultureInfo culture ) : FieldInfo

Selects a field from the given set of fields, based on the specified criteria.

BindToMethod ( BindingFlags bindingAttr, MethodBase match, object &args, ParameterModifier modifiers, CultureInfo culture, string names, object &state ) : MethodBase

Selects a method to invoke from the given set of methods, based on the supplied arguments.

ChangeType ( object value, Type type, CultureInfo culture ) : object

Changes the type of the given Object to the given Type.

ImplicitMethodBinder ( Type sourceType, Type targetType ) : System

Initializes a new instance of the ImplicitMethodBinder class.

ReorderArgumentArray ( object &args, object state ) : void

Upon returning from M:System.Reflection.Binder.BindToMethod(System.Reflection.BindingFlags,System.Reflection.MethodBase[],System.Object[]@,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],System.Object@), restores the args argument to what it was when it came from BindToMethod.

SelectMethod ( BindingFlags bindingAttr, MethodBase match, Type types, ParameterModifier modifiers ) : MethodBase

Selects a method from the given set of methods, based on the argument type.

SelectProperty ( BindingFlags bindingAttr, PropertyInfo match, Type returnType, Type indexes, ParameterModifier modifiers ) : PropertyInfo

Selects a property from the given set of properties, based on the specified criteria.

Method Details

BindToField() public method

Selects a field from the given set of fields, based on the specified criteria.
For the default binder, includes , and contains multiple fields that are equally good matches for . For example, contains a MyClass object that implements the IMyClass interface, and contains a field of type MyClass and a field of type IMyClass. /// For the default binder, includes , and contains no fields that can accept . /// For the default binder, includes , and is null or an empty array. /// -or- /// includes , and is null. ///
public BindToField ( BindingFlags bindingAttr, FieldInfo match, object value, CultureInfo culture ) : FieldInfo
bindingAttr BindingFlags A bitwise combination of values. ///
match System.Reflection.FieldInfo The set of fields that are candidates for matching. For example, when a object is used by , 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 changes the order of this array. ///
value object The field value used to locate a matching field. ///
culture System.Globalization.CultureInfo An instance of that is used to control the coercion of data types, in binder implementations that coerce types. If is null, the for the current thread is used. /// Note: /// For example, if a binder implementation allows coercion of string values to numeric types, this parameter is necessary to convert a /// String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. The default binder does not do such string coercions. ///
return System.Reflection.FieldInfo

BindToMethod() public method

Selects a method to invoke from the given set of methods, based on the supplied arguments.
For the default binder, contains multiple methods that are equally good matches for . For example, contains a MyClass object that implements the IMyClass interface, and contains a method that takes MyClass and a method that takes IMyClass. /// For the default binder, contains no methods that can accept the arguments supplied in . /// For the default binder, is null or an empty array. ///
public BindToMethod ( BindingFlags bindingAttr, MethodBase match, object &args, ParameterModifier modifiers, CultureInfo culture, string names, object &state ) : MethodBase
bindingAttr BindingFlags A bitwise combination of values. ///
match System.Reflection.MethodBase The set of methods that are candidates for matching. For example, when a object is used by , 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 changes the order of this array. ///
args object The arguments that are passed in. The binder can change the order of the arguments in this array; for example, the default binder changes the order of arguments if the parameter is used to specify an order other than positional order. If a binder implementation coerces argument types, the types and values of the arguments can be changed as well. ///
modifiers System.Reflection.ParameterModifier An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. The default binder implementation does not use this parameter. ///
culture System.Globalization.CultureInfo An instance of that is used to control the coercion of data types, in binder implementations that coerce types. If is null, the for the current thread is used. /// Note: /// For example, if a binder implementation allows coercion of string values to numeric types, this parameter is necessary to convert a /// String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. The default binder does not do such string coercions. ///
names string The parameter names, if parameter names are to be considered when matching, or null if arguments are to be treated as purely positional. For example, parameter names must be used if arguments are not supplied in positional order. ///
state object After the method returns, contains a binder-provided object that keeps track of argument reordering. The binder creates this object, and the binder is the sole consumer of this object. If is not null when BindToMethod returns, you must pass to the method if you want to restore to its original order, for example, so that you can retrieve the values of ref parameters (ByRef parameters in Visual Basic). ///
return System.Reflection.MethodBase

ChangeType() public method

Changes the type of the given Object to the given Type.
public ChangeType ( object value, Type type, CultureInfo culture ) : object
value object The object to change into a new Type. ///
type System.Type The new Type that will become. ///
culture System.Globalization.CultureInfo An instance of that is used to control the coercion of data types. If is null, the for the current thread is used. /// Note: /// For example, this parameter is necessary to convert a /// String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. ///
return object

ImplicitMethodBinder() public method

Initializes a new instance of the ImplicitMethodBinder class.
public ImplicitMethodBinder ( Type sourceType, Type targetType ) : System
sourceType System.Type Type of the source.
targetType System.Type Type of the destination.
return System

ReorderArgumentArray() public method

Upon returning from M:System.Reflection.Binder.BindToMethod(System.Reflection.BindingFlags,System.Reflection.MethodBase[],System.Object[]@,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],System.Object@), restores the args argument to what it was when it came from BindToMethod.
public ReorderArgumentArray ( object &args, object state ) : void
args object The actual arguments that are passed in. Both the types and values of the arguments can be changed. ///
state object A binder-provided object that keeps track of argument reordering. ///
return void

SelectMethod() public method

Selects a method from the given set of methods, based on the argument type.
For the default binder, contains multiple methods that are equally good matches for the parameter types described by . For example, the array in contains a object for MyClass and the array in contains a method that takes a base class of MyClass and a method that takes an interface that MyClass implements. /// For the default binder, is null or an empty array. /// -or- /// An element of derives from , but is not of type RuntimeType. ///
public SelectMethod ( BindingFlags bindingAttr, MethodBase match, Type types, ParameterModifier modifiers ) : MethodBase
bindingAttr BindingFlags A bitwise combination of values. ///
match System.Reflection.MethodBase The set of methods that are candidates for matching. For example, when a object is used by , 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 changes the order of this array. ///
types System.Type The parameter types used to locate a matching method. ///
modifiers System.Reflection.ParameterModifier An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. ///
return System.Reflection.MethodBase

SelectProperty() public method

Selects a property from the given set of properties, based on the specified criteria.
For the default binder, contains multiple properties that are equally good matches for and . /// For the default binder, is null or an empty array. ///
public SelectProperty ( BindingFlags bindingAttr, PropertyInfo match, Type returnType, Type indexes, ParameterModifier modifiers ) : PropertyInfo
bindingAttr BindingFlags A bitwise combination of values. ///
match System.Reflection.PropertyInfo The set of properties that are candidates for matching. For example, when a object is used by , 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 changes the order of this array. ///
returnType System.Type The return value the matching property must have. ///
indexes System.Type The index types of the property being searched for. Used for index properties such as the indexer for a class. ///
modifiers System.Reflection.ParameterModifier An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. ///
return System.Reflection.PropertyInfo