HierarchicalDataBoundControlDesigner.PreFilterProperties(IDictionary) Metod

Definition

Används av designern för att ta bort egenskaper från eller lägga till ytterligare egenskaper i visningen i rutnätet Egenskaper eller skuggegenskaper för den associerade kontrollen.

protected:
 override void PreFilterProperties(System::Collections::IDictionary ^ properties);
protected override void PreFilterProperties(System.Collections.IDictionary properties);
override this.PreFilterProperties : System.Collections.IDictionary -> unit
Protected Overrides Sub PreFilterProperties (properties As IDictionary)

Parametrar

properties
IDictionary

En samling som implementerar de IDictionary tillagda och skuggade egenskaperna.

Exempel

I följande kodexempel visas hur du åsidosätter PreFilterProperties metoden i en klass som ärvs från HierarchicalDataBoundControlDesigner klassen för att ändra rutnätet Egenskaper för HierarchicalDataBoundControl kontrollen vid designtillfället. Exemplet gör egenskapen NamingContainer synlig i rutnätet Egenskaper .

// Shadow the control properties with design-time properties.
protected override void PreFilterProperties(IDictionary properties)
{
    string namingContainer = "NamingContainer";

    // Call the base method first.
    base.PreFilterProperties(properties);

    // Make the NamingContainery visible in the Properties grid.
    PropertyDescriptor selectProp =
        (PropertyDescriptor)properties[namingContainer];
    properties[namingContainer] =
        TypeDescriptor.CreateProperty(selectProp.ComponentType,
            selectProp, BrowsableAttribute.Yes);
} // PreFilterProperties
' Shadow the control properties with design-time properties.
Protected Overrides Sub PreFilterProperties( _
    ByVal properties As IDictionary)

    Dim namingContainer As String = "NamingContainer"

    ' Call the base method first.
    MyBase.PreFilterProperties(properties)

    ' Make the NamingContainery visible in the Properties grid.
    Dim selectProp As PropertyDescriptor = _
        CType(properties(namingContainer), PropertyDescriptor)
    properties(namingContainer) = _
        TypeDescriptor.CreateProperty(selectProp.ComponentType, _
            selectProp, BrowsableAttribute.Yes)
End Sub

Kommentarer

Kontrolldesigners använder metoder som härleds från ComponentDesigner.PreFilterProperties metoden för att skugga olika kontrollegenskaper med motsvarande designtidsegenskaper som designern implementerar och för att lägga till egenskaper i eller ta bort egenskaper från rutnätet Egenskaper .

För kontroller som härleds från HierarchicalDataBoundControl klassen PreFilterProperties skapar metoden egenskaper för designtid för att skugga DataSource egenskaperna och DataSourceID .

Anteckningar till arvingar

Åsidosätt PreFilterProperties(IDictionary) metoden för att lägga till egenskaper i eller ändra egenskapernas attribut i egenskapssamlingen design-time. Var noga med att anropa basmetoden innan du utför annan bearbetning.

Gäller för

Se även