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. 「內容」 (coNtext) 是一組屬性或使用規則, 可定義物件集合所在的環境。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. 未內容系結的物件稱為 agile 物件。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.

給繼承者的注意事項

目前的 common language runtime 版本不支援具有泛型方法的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)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。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()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。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 的淺層複本 (Shallow Copy)。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)

適用於

另請參閱