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() 方法取決於預設功能。 若要為擴充類別的類別提供 advanced 行為, ContextAttribute 並覆寫 Name 屬性,您也必須覆寫和方法的預設實值 Equals(Object) GetHashCode()

建構函式

ContextAttribute(String)

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

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

欄位

AttributeName

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

表示內容屬性的名稱。

屬性

Name

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

取得內容屬性的名稱。

TypeId

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

(繼承來源 Attribute)

方法

Equals(Object)

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

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

Freeze(Context)

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

在內容已凍結時呼叫。

GetHashCode()

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

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

GetPropertiesForNewContext(IConstructionCallMessage)

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

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

GetType()

取得目前執行個體的 Type

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

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

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

IsDefaultAttribute()

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

(繼承來源 Attribute)
IsNewContextOK(Context)

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

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

Match(Object)

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

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

明確介面實作

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

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

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

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

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

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

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

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

(繼承來源 Attribute)

適用於