C# Класс Microsoft.Scripting.Actions.MemberTracker

Represents a logical member of a type. The member could either be real concrete member on a type or an extension member. This seperates the "physical" members that .NET knows exist on types from the members that logically exist on a type. It also provides other abstractions above the level of .NET reflection such as MemberGroups and NamespaceTracker's. It also provides a wrapper around the reflection APIs which cannot be extended from partial trust.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BindToInstance ( DynamicMetaObject instance ) : MemberTracker

Binds the member tracker to the specified instance rturning a new member tracker if binding is possible. If binding is not possible the existing member tracker will be returned. For example binding to a static field results in returning the original MemberTracker. Binding to an instance field results in a new BoundMemberTracker which will get GetBoundValue/SetBoundValue to pass the instance through.

FromMemberInfo ( MemberInfo member ) : MemberTracker
FromMemberInfo ( MemberInfo member, Type extending ) : MemberTracker
GetBoundError ( ActionBinder binder, DynamicMetaObject instance ) : ErrorInfo

Returns the error associated with accessing this member via a bound instance. A null return value indicates that the default error message should be provided by the caller.

GetError ( ActionBinder binder ) : ErrorInfo

Returns the error associated with getting the value. A null return value indicates that the default error message should be provided by the caller.

GetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type ) : DynamicMetaObject

Gets the expression that creates the value. Returns null if it's an error to get the value. The caller can then call GetErrorForGet to get the correct error Expression (or null if they should provide a default).

SetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value ) : DynamicMetaObject

Gets an expression that assigns a value to the left hand side. Returns null if it's an error to assign to. The caller can then call GetErrorForSet to get the correct error Expression (or null if a default error should be provided).

SetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject errorSuggestion ) : DynamicMetaObject

Gets an expression that assigns a value to the left hand side. Returns null if it's an error to assign to. The caller can then call GetErrorForSet to get the correct error Expression (or null if a default error should be provided).

Защищенные методы

Метод Описание
GetBoundValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance ) : DynamicMetaObject

Helper for getting values that have been bound. Called from BoundMemberTracker. Custom member trackers can override this to provide their own behaviors when bound to an instance.

SetBoundValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject instance ) : DynamicMetaObject

Helper for setting values that have been bound. Called from BoundMemberTracker. Custom member trackers can override this to provide their own behaviors when bound to an instance.

SetBoundValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject instance, DynamicMetaObject errorSuggestion ) : DynamicMetaObject

Helper for setting values that have been bound. Called from BoundMemberTracker. Custom member trackers can override this to provide their own behaviors when bound to an instance.

Приватные методы

Метод Описание
Call ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder ) : DynamicMetaObject
MemberTracker ( ) : System

Описание методов

BindToInstance() публичный Метод

Binds the member tracker to the specified instance rturning a new member tracker if binding is possible. If binding is not possible the existing member tracker will be returned. For example binding to a static field results in returning the original MemberTracker. Binding to an instance field results in a new BoundMemberTracker which will get GetBoundValue/SetBoundValue to pass the instance through.
public BindToInstance ( DynamicMetaObject instance ) : MemberTracker
instance System.Dynamic.DynamicMetaObject
Результат MemberTracker

FromMemberInfo() публичный статический Метод

public static FromMemberInfo ( MemberInfo member ) : MemberTracker
member System.Reflection.MemberInfo
Результат MemberTracker

FromMemberInfo() публичный статический Метод

public static FromMemberInfo ( MemberInfo member, Type extending ) : MemberTracker
member System.Reflection.MemberInfo
extending System.Type
Результат MemberTracker

GetBoundError() публичный Метод

Returns the error associated with accessing this member via a bound instance. A null return value indicates that the default error message should be provided by the caller.
public GetBoundError ( ActionBinder binder, DynamicMetaObject instance ) : ErrorInfo
binder ActionBinder
instance System.Dynamic.DynamicMetaObject
Результат ErrorInfo

GetBoundValue() защищенный Метод

Helper for getting values that have been bound. Called from BoundMemberTracker. Custom member trackers can override this to provide their own behaviors when bound to an instance.
protected GetBoundValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
instance System.Dynamic.DynamicMetaObject
Результат System.Dynamic.DynamicMetaObject

GetError() публичный Метод

Returns the error associated with getting the value. A null return value indicates that the default error message should be provided by the caller.
public GetError ( ActionBinder binder ) : ErrorInfo
binder ActionBinder
Результат ErrorInfo

GetValue() публичный Метод

Gets the expression that creates the value. Returns null if it's an error to get the value. The caller can then call GetErrorForGet to get the correct error Expression (or null if they should provide a default).
public GetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
Результат System.Dynamic.DynamicMetaObject

SetBoundValue() защищенный Метод

Helper for setting values that have been bound. Called from BoundMemberTracker. Custom member trackers can override this to provide their own behaviors when bound to an instance.
protected SetBoundValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject instance ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
value System.Dynamic.DynamicMetaObject
instance System.Dynamic.DynamicMetaObject
Результат System.Dynamic.DynamicMetaObject

SetBoundValue() защищенный Метод

Helper for setting values that have been bound. Called from BoundMemberTracker. Custom member trackers can override this to provide their own behaviors when bound to an instance.
protected SetBoundValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject instance, DynamicMetaObject errorSuggestion ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
value System.Dynamic.DynamicMetaObject
instance System.Dynamic.DynamicMetaObject
errorSuggestion System.Dynamic.DynamicMetaObject
Результат System.Dynamic.DynamicMetaObject

SetValue() публичный Метод

Gets an expression that assigns a value to the left hand side. Returns null if it's an error to assign to. The caller can then call GetErrorForSet to get the correct error Expression (or null if a default error should be provided).
public SetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
value System.Dynamic.DynamicMetaObject
Результат System.Dynamic.DynamicMetaObject

SetValue() публичный Метод

Gets an expression that assigns a value to the left hand side. Returns null if it's an error to assign to. The caller can then call GetErrorForSet to get the correct error Expression (or null if a default error should be provided).
public SetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject errorSuggestion ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
value System.Dynamic.DynamicMetaObject
errorSuggestion System.Dynamic.DynamicMetaObject
Результат System.Dynamic.DynamicMetaObject