ContextBoundObject 類別

定義

定義所有內容繫結類別的基底類別。Defines the base class for all context-bound classes.

public ref class ContextBoundObject abstract : MarshalByRefObject
public abstract class ContextBoundObject : MarshalByRefObject
[System.Serializable]
public abstract class ContextBoundObject : MarshalByRefObject
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class ContextBoundObject : MarshalByRefObject
type ContextBoundObject = class
    inherit MarshalByRefObject
[<System.Serializable>]
type ContextBoundObject = class
    inherit MarshalByRefObject
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ContextBoundObject = class
    inherit MarshalByRefObject
Public MustInherit Class ContextBoundObject
Inherits MarshalByRefObject
繼承
ContextBoundObject
衍生
屬性

備註

位於內容且系結至內容規則的物件稱為內容系結物件。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. 未內容系結的物件稱為 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 類別的執行個體。Instantiates an instance of the ContextBoundObject class.

方法

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetLifetimeService()
已過時。

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InitializeLifetimeService()
已過時。

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱