語言

ContextAttribute 類別

定義

提供 IContextAttribute 和 IContextProperty 介面的預設實作。

此 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,context 屬性與 context 屬性皆屬於類別。 對於更專門或更複雜的需求,情境屬性可以從衍生出來 ContextAttribute ,情境屬性則可拆分成獨立類別。 欲了解更多屬性的使用資訊,請參閱屬性。

給繼承者的注意事項

Name該屬性不得在任何使用者衍生類別中被覆寫。 目前Equals(Object)GetHashCode()和方法取決於預設功能。 要為類別ContextAttribute提供進階行為並覆寫Name該屬性,你也必須覆蓋 and Equals(Object) 方法的預設實作GetHashCode()。

建構函式

名稱 Description
ContextAttribute(String)

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

建立一個帶有指定名稱的 ContextAttribute 類別實例。

欄位

名稱 Description
AttributeName

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

表示上下文屬性的名稱。

屬性

名稱 Description
Name

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

會取得上下文屬性的名稱。

TypeId

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

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

(繼承來源 Attribute)

方法

名稱 Description
Equals(Object)

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

回傳一個布林值,表示該實例是否等於指定物件。

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)

明確介面實作

名稱 Description
_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)

適用於