语言

Context.RegisterDynamicProperty 方法

定义

使用远程处理服务注册实现 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

要注册的动态属性。

obj
ContextBoundObject

为其注册的对象/代理 property 。

ctx
Context

为其注册的 property 上下文。

返回

true 如果属性已成功注册,则为否则,为 false.

例外

要么 prop 是名称 null,要么不是动态的(它不实现 IDynamicProperty)。

同时指定对象和上下文(两者objctx均未null指定)。

注解

根据 obj 和 ctx, prop 被要求提供一个接收器,该接收器放置在远程处理调用的路径中的某个位置。 如果注册了多个属性,则会按任意顺序调用其接收器,以便在调用之间更改。

如果 obj 不是 null,则如果是代理,则会截获对代理所做的所有调用。 否则,如果 obj 为实际对象,则会截获对对象的所有调用。 参数 ctx 必须是 null.

如果 ctx 不是 null, obj 则必须 null 是进入和离开上下文的所有调用将被截获。

如果同时ctx存在,objnull则所有进入和离开所有上下文的调用都会被截获。

适用于