ContextBoundObject ContextBoundObject ContextBoundObject ContextBoundObject Class

定义

定义所有上下文绑定类的基类。Defines the base class for all context-bound classes.

public ref class ContextBoundObject abstract : MarshalByRefObject
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public abstract class ContextBoundObject : MarshalByRefObject
type ContextBoundObject = class
    inherit MarshalByRefObject
Public MustInherit Class ContextBoundObject
Inherits MarshalByRefObject
继承
ContextBoundObjectContextBoundObjectContextBoundObjectContextBoundObject
派生
属性

注解

驻留在上下文中并绑定到上下文规则的对象称为上下文绑定对象。Objects that reside in a context and are bound to the context rules are called context-bound objects. 上下文是一组属性或使用规则, 用于定义对象集合所在的环境。A context is a set of properties or usage rules that define an environment where a collection of objects resides. 当对象进入或离开上下文时, 将强制执行这些规则。The rules are enforced when the objects are entering or leaving a context. 不是上下文绑定的对象称为敏捷对象。Objects that are not context-bound are called agile objects.

上下文是在对象激活过程中创建的。Contexts are created during object activation. 新的对象将被置于现有上下文或使用类型元数据中包含的属性创建的新上下文中。A new object is placed into an existing context or into a new context created using the attributes included in the metadata of the type. 上下文绑定类用ContextAttribute提供使用规则的标记。Context-bound classes are marked with a ContextAttribute that provides the usage rules. 可以添加的上下文属性包括有关同步和事务的策略。The context properties that can be added include policies regarding synchronization and transactions.

继承者说明

当前版本的公共语言运行时不支持具有泛型方法ContextBoundObject的泛型类型ContextBoundObject或非泛型类型。The current version of the common language runtime does not support generic ContextBoundObject types or nongeneric ContextBoundObject types that have generic methods. 尝试创建此类类型的实例会导致TypeLoadExceptionAttempting to create an instance of such a type causes a TypeLoadException.

构造函数

ContextBoundObject() ContextBoundObject() ContextBoundObject() ContextBoundObject()

实例化 ContextBoundObject 类的实例。Instantiates an instance of the ContextBoundObject class.

方法

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅