Context.RegisterDynamicProperty 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
用远程处理服务注册实现 IDynamicProperty 接口的动态属性。
此 API 支持产品基础结构,不能在代码中直接使用。
public:
static bool RegisterDynamicProperty(System::Runtime::Remoting::Contexts::IDynamicProperty ^ prop, ContextBoundObject ^ obj, System::Runtime::Remoting::Contexts::Context ^ ctx);
public static bool RegisterDynamicProperty (System.Runtime.Remoting.Contexts.IDynamicProperty prop, ContextBoundObject obj, System.Runtime.Remoting.Contexts.Context ctx);
static member RegisterDynamicProperty : System.Runtime.Remoting.Contexts.IDynamicProperty * ContextBoundObject * System.Runtime.Remoting.Contexts.Context -> bool
Public Shared Function RegisterDynamicProperty (prop As IDynamicProperty, obj As ContextBoundObject, ctx As Context) As Boolean
参数
- prop
- IDynamicProperty
要注册的动态属性。
为其注册 的对象/代理 property 。
- ctx
- Context
为其注册 的上下文 property 。
返回
如果该属性已成功注册,则为 true;否则为 false。
例外
要么 prop 或其名称为 null,要么它不是动态的(不实现 IDynamicProperty)。
对象和上下文都已指定(obj 和 ctx 都不为 null)。
注解
基于 obj 和 ctx, prop 要求提供一个接收器,该接收器放置在远程处理调用路径中的某个位置。 如果注册了多个属性,则其接收器将按可在调用之间更改的任意顺序调用。
如果 obj 不是 null,则如果它是代理,则会截获对代理进行的所有调用。 否则,如果 obj 是真实对象,则截获该对象的所有调用。 参数 ctx 必须为 null。
如果 ctx 不是 null, obj 则必须 为 null ,并且将截获所有进入和离开上下文的调用。
如果 和 obj 都是 ctx ,则null截获所有进入和离开所有上下文的调用。