Share via


SynchronizationAttribute.IsContextOK 方法

定义

返回一个指示该上下文参数是否满足上下文特性要求的布尔值。

public:
 override bool IsContextOK(System::Runtime::Remoting::Contexts::Context ^ ctx, System::Runtime::Remoting::Activation::IConstructionCallMessage ^ msg);
public override bool IsContextOK (System.Runtime.Remoting.Contexts.Context ctx, System.Runtime.Remoting.Activation.IConstructionCallMessage msg);
[System.Runtime.InteropServices.ComVisible(true)]
public override bool IsContextOK (System.Runtime.Remoting.Contexts.Context ctx, System.Runtime.Remoting.Activation.IConstructionCallMessage msg);
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.SecurityCritical]
public override bool IsContextOK (System.Runtime.Remoting.Contexts.Context ctx, System.Runtime.Remoting.Activation.IConstructionCallMessage msg);
override this.IsContextOK : System.Runtime.Remoting.Contexts.Context * System.Runtime.Remoting.Activation.IConstructionCallMessage -> bool
[<System.Runtime.InteropServices.ComVisible(true)>]
override this.IsContextOK : System.Runtime.Remoting.Contexts.Context * System.Runtime.Remoting.Activation.IConstructionCallMessage -> bool
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Security.SecurityCritical>]
override this.IsContextOK : System.Runtime.Remoting.Contexts.Context * System.Runtime.Remoting.Activation.IConstructionCallMessage -> bool
Public Overrides Function IsContextOK (ctx As Context, msg As IConstructionCallMessage) As Boolean

参数

ctx
Context

要检查的上下文。

msg
IConstructionCallMessage

在构造由该特性标记的上下文绑定对象时收集的信息。 在确定是否可以接受该上下文时,SynchronizationAttribute 可以在该上下文中检查、添加和移除属性。

返回

如果传入的上下文一切正常,则为 true;否则为 false

属性

例外

ctxmsg 参数为 null

适用于