Skip to end of metadata
Go to start of metadata

Definition

public class ObjectBinding : IObjectBinding

Summary

The following table summarizes the members exposed in this class.

Public Constructors

ObjectBinding Constructor() Initializes a new instance of the ObjectBinding class.

Public Methods

BindToConstructor(Type, Object[]) Binds to constructor
BindToIndex(object, Object[], bool) Binds to index property
BindToMember(object, string, bool) Late binding to any member of a given object
BindToMethod(object, string, Type[], Object[]) Binds to method
BindToMethod(object, MethodInfo, Object[]) Binds to method
CanBind(MemberInfo) Checks binding conditions for given type member. Could be overriden in derived classes. This implementation uses BindableAttribute for evaluating conditions
ConvertTo(object, Type) Method used to convert value to target type. Should be used for any conversion during script execution

Protected Methods


Public Constructors

public ObjectBinding()

Public Methods

public IBinding BindToConstructor(Type targetType, Object[] arguments)

Binds to constructor

Parameters

targetType Type
arguments Arguments for constructor

Return Types

ConstructorBind or null

public IBinding BindToIndex(object target, Object[] arguments, bool setter)

Binds to index property

Parameters

target instance on an object
arguments arguments
setter if true binds to setter, otherwise to getter

Return Types

MethodBind or null if binding is not possible

public IMemberBinding BindToMember(object target, string memberName, bool throwNotFound)

Late binding to any member of a given object

Parameters

target instance of a object
memberName name of the method to bind
throwNotFound if true will throw member not found exception at first attempt to invoke the binding

Return Types

LateBoundMember

public IBinding BindToMethod(object target, string methodName, Type[] genericParameters, Object[] arguments)

Binds to method

Parameters

target instance on an object
methodName name of the method
genericParameters for generic methods should specify types other vise empty array of type
arguments arguments for method

Return Types

MethodBind or null if binding is not possible

public IBinding BindToMethod(object target, MethodInfo method, Object[] arguments)

Binds to method

Parameters

target instance on an object
method specific method
arguments arguments for method

Return Types

MethodBind or null if binding is not possible

public bool CanBind(MemberInfo member)

Checks binding conditions for given type member. Could be overriden in derived classes. This implementation uses BindableAttribute for evaluating conditions

Parameters

member Instance of MemberInfo

Return Types

true if member could participate in binding

public object ConvertTo(object value, Type targetType)

Method used to convert value to target type. Should be used for any conversion during script execution

Parameters

value value to convert or null
targetType target type

Return Types

Converted value or NoResult constant if conversion impossible

Protected Methods

protected IBinding BindToMethod(object target, Func<MethodInfo, bool> methodSelector, Type[] genericParameters, Object[] arguments)

Binds to method of a given object including interface methods

Parameters

target instance on an object
methodSelector Predicate to select methods
genericParameters for generic methods should specify types other vise empty array of type
arguments arguments for method

Return Types

MethodBind or null if binding is not possible

protected IBinding BindToMethods(object target, Type[] genericParameters, Object[] arguments, IEnumerable<MethodInfo> methods)

Parameters

target
genericParameters
arguments
methods
  • No labels