ContextAttribute 類別

定義

提供 IContextAttributeIContextProperty 介面的預設實作。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public ref class ContextAttribute : Attribute, System::Runtime::Remoting::Contexts::IContextAttribute, System::Runtime::Remoting::Contexts::IContextProperty
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.SecurityCritical]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextProperty
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextProperty
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Security.SecurityCritical>]
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextProperty
Public Class ContextAttribute
Inherits Attribute
Implements IContextAttribute, IContextProperty
繼承
ContextAttribute
衍生
屬性
實作

備註

類別 ContextAttribute 是所有內容屬性的根目錄。 簡單 Context 類別屬性可以使用內容屬性和類別中的內容屬性衍生 ContextAttribute 自 。 如需更特製化或更複雜的需求,內容屬性可以衍生自 ContextAttribute ,而內容屬性可以分割成不同的類別。 如需使用屬性的詳細資訊,請參閱 屬性

給繼承者的注意事項

Name屬性不得在任何使用者衍生類別中覆寫。 目前的 Equals(Object)GetHashCode() 方法取決於預設功能。 若要提供擴充 ContextAttribute 類別並覆寫 屬性的類別進階行為,您也必須覆寫 NameGetHashCode() 方法的默認實Equals(Object)作。

建構函式

ContextAttribute(String)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

使用指定的名稱來建立 ContextAttribute 類別的執行個體。

欄位

AttributeName

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

表示內容屬性的名稱。

屬性

Name

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

取得內容屬性的名稱。

TypeId

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)

方法

Equals(Object)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

傳回布林 (Boolean) 值,指出這個執行個體是否等於指定的物件。

Freeze(Context)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

在內容已凍結時呼叫。

GetHashCode()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

傳回 ContextAttribute 的這個執行個體的雜湊程式碼。

GetPropertiesForNewContext(IConstructionCallMessage)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

將目前的內容屬性加入至指定的訊息。

GetType()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

取得目前執行個體的 Type

(繼承來源 Object)
IsContextOK(Context, IConstructionCallMessage)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

傳回布林值,指出是否內容參數符合內容屬性的需求。

IsDefaultAttribute()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。

(繼承來源 Attribute)
IsNewContextOK(Context)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

傳回布林值,指出內容屬性是否與新內容相容。

Match(Object)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

擷取物件的類型資訊,可以用來取得介面的類型資訊。

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

擷取物件提供的類型資訊介面數目 (0 或 1)。

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

提供物件所公開的屬性和方法的存取權。

(繼承來源 Attribute)

適用於