Share via


MetadataStore クラス

定義

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 に対する呼び出しで使用されます。

メソッド

AddAttributeTable(AttributeTable)

指定したテーブルを現在の AppDomain オブジェクトの属性ストアに追加します。

適用対象