MetadataStore 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
一個記憶體中的雜湊表集合,允許透過 快速查找設計元素 Type。
public ref class MetadataStore abstract sealed
public static class MetadataStore
type MetadataStore = class
Public Class MetadataStore
- 繼承
-
MetadataStore
範例
以下程式碼範例說明如何將自訂活動設計器與自訂活動關聯 ActivityDesigner1 起來。 欲了解更多如何建立自訂活動設計器的資訊,請參閱 「如何建立自訂活動設計器」。
internal class Metadata : IRegisterMetadata
{
private AttributeTable attributes;
// Called by the designer to register any design-time metadata.
public void Register()
{
AttributeTableBuilder builder = new AttributeTableBuilder();
// Add the custom attributes to associate the ActivityDesigner1 custom designer
// with the custom activity MyActivity.
builder.AddCustomAttributes(
typeof(MyActivity),
new DesignerAttribute(typeof(ActivityDesigner1)));
MetadataStore.AddAttributeTable(builder.CreateTable());
}
}
備註
中繼資料儲存包含自訂屬性的中繼資料,例如設計器與型別之間的關聯。 自訂屬性可以在 中 AttributeTable 定義並加入元資料儲存庫。 屬性加入後,它們會出現在呼叫 TypeDescriptor。
方法
| 名稱 | Description |
|---|---|
| AddAttributeTable(AttributeTable) |
將給定的資料表加入目前 AppDomain 物件的屬性儲存庫。 |