MetadataUpdateHandlerAttribute 類別

定義

指出應該接收元數據更新通知的類型。

public ref class MetadataUpdateHandlerAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class MetadataUpdateHandlerAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)>]
type MetadataUpdateHandlerAttribute = class
    inherit Attribute
Public NotInheritable Class MetadataUpdateHandlerAttribute
Inherits Attribute
繼承
MetadataUpdateHandlerAttribute
屬性

備註

Type此屬性所指定的 應該實作符合下列一或多個 (方法之簽章的靜態方法,方法的可見度並不重要) :

  • static void ClearCache(Type[]? updatedTypes)
  • static void UpdateApplication(Type[]? updatedTypes)

套用元資料更新之後, ClearCache 會針對指定一個的處理程式叫用 。 這可讓更新處理程式有機會清除根據應用程式元數據推斷的任何快取。 叫用所有 ClearCache 方法之後, UpdateApplication 會針對每個指定一個的處理程式叫用 。 這可讓應用程式重新整理應用程式狀態、觸發UI重新轉譯或其他這類反應。 指定時, updatedTypes 參數會包含受元數據更新影響的型別集合;如果是 null,則任何類型可能都已更新。

建構函式

MetadataUpdateHandlerAttribute(Type)

初始化屬性。

屬性

HandlerType

取得處理元數據更新的型別,以及應該在任何發生時收到通知的類型。

TypeId

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

(繼承來源 Attribute)

方法

Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。

(繼承來源 Attribute)
GetHashCode()

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

(繼承來源 Attribute)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

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

(繼承來源 Attribute)
Match(Object)

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

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於