System.Runtime.Remoting.Contexts Namespace

System.Runtime.Remoting.Contexts 命名空间包含一些定义所有对象所驻留的上下文的对象。 The System.Runtime.Remoting.Contexts namespace contains objects that define the contexts all objects reside within. 上下文是一个有序的属性序列,用于定义其中的对象所处的环境。 A context is an ordered sequence of properties that defines an environment for the objects within it. 上下文是在对象的激活过程中创建的,这些对象被配置为要求某些自动服务,如同步、事务、实时 (JIT) 激活、安全性等。 Contexts are created during the activation process for objects that are configured to require certain automatic services such synchronization, transactions, just-in-time (JIT) activation, security, and so on. 多个对象可以存留在一个上下文内。 Multiple objects can live inside a context.

Context

为驻留在其中的对象定义环境,在此环境中可以实施策略。Defines an environment for the objects that are resident inside it and for which a policy can be enforced.

ContextAttribute

提供 IContextAttributeIContextProperty 接口的默认实现。Provides the default implementations of the IContextAttribute and IContextProperty interfaces.

ContextProperty

保存属性名称的名称/值对和表示上下文属性的对象。Holds the name/value pair of the property name and the object representing the property of a context.

SynchronizationAttribute

为当前上下文和所有共享同一实例的上下文强制一个同步域。Enforces a synchronization domain for the current context and all contexts that share the same instance.

接口

IContextAttribute

标识上下文特性。Identifies a context attribute.

IContextProperty

从上下文属性收集命名信息,并确定新上下文是否与上下文属性兼容。Gathers naming information from the context property and determines whether the new context is ok for the context property.

IContextPropertyActivator

指示实现的属性要参与激活而且可能未提供消息接收器。Indicates that the implementing property is interested in participating in activation and might not have provided a message sink.

IContributeClientContextSink

在远程处理调用的客户端上的上下文边界上分配侦听接收器。Contributes an interception sink at the context boundary on the client end of a remoting call.

IContributeDynamicSink

指示实现属性将在运行时通过 RegisterDynamicProperty(IDynamicProperty, ContextBoundObject, Context) 方法注册。Indicates that the implementing property will be registered at runtime through the RegisterDynamicProperty(IDynamicProperty, ContextBoundObject, Context) method.

IContributeEnvoySink

在客户端分配特使消息接收器。Contributes an envoy message sink on the client end.

IContributeObjectSink

在远程处理调用的服务器端分配对象特定的侦听接收器。Contributes an object-specific interception sink on the server end of a remoting call.

IContributeServerContextSink

在远程处理调用的服务器端上的上下文边界上分配侦听接收器。Contributes an interception sink at the context boundary on the server end of a remoting call.

IDynamicMessageSink

指示实现的消息接收器将由动态注册的属性提供。Indicates that the implementing message sink will be provided by dynamically registered properties.

IDynamicProperty

指示实现的属性应该在运行时通过 RegisterDynamicProperty(IDynamicProperty, ContextBoundObject, Context) 方法注册。Indicates that the implementing property should be registered at runtime through the RegisterDynamicProperty(IDynamicProperty, ContextBoundObject, Context) method.

委托

CrossContextDelegate

表示处理执行其他上下文中的某些代码的请求的方法。Represents the method that will handle the requests of execution of some code in another context.

注解

每当创建新对象时的.net 就查找兼容上下文框架或创建新的上下文对象。Whenever a new object is created, the.NET Framework finds a compatible context or creates a new context for the object. 一个对象放置到上下文中后,将一直留在其生命周期。After an object is placed in a context, it stays in it for life. 可以绑定到上下文的类称为上下文绑定类。Classes that can be bound to a context are called context-bound classes. 从另一个上下文访问时,会引用这些上下文绑定类,直接使用代理。When accessed from another context, these context-bound classes are referenced directly using a proxy. 从一个上下文中的对象到另一个上下文中的对象的调用将经过上下文代理,并受到由组合的上下文属性实现的策略。A call from an object in one context to an object in another context will go through a context proxy and be affected by the policy implemented by the combined context properties.