MetadataStore Klass

Definition

En minnesintern samling hash-tabeller som möjliggör snabb sökning av designerelement av Type.

public ref class MetadataStore abstract sealed
public static class MetadataStore
type MetadataStore = class
Public Class MetadataStore
Arv
MetadataStore

Exempel

I följande kodexempel visas hur du associerar den ActivityDesigner1 anpassade aktivitetsdesignern med en anpassad aktivitet. Mer information om hur du skapar anpassade aktivitetsdesigners finns i Så här skapar du en anpassad aktivitetsdesigner.

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());  

    }  
}  

Kommentarer

Metadatalagret innehåller anpassade attributmetadata, till exempel associationen mellan designers och typer. Anpassade attribut kan definieras i ett AttributeTable och läggas till i metadatalagret. När attributen har lagts till visas de i anrop till TypeDescriptor.

Metoder

Name Description
AddAttributeTable(AttributeTable)

Lägger till den angivna tabellen i det aktuella AppDomain objektets attributarkiv.

Gäller för