LoginViewDesigner.PreFilterProperties(IDictionary) Metod

Definition

Används av designern för att ta bort egenskaper från eller lägga till 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 IDictionary de tillagda eller skuggade egenskaperna.

Exempel

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

// Shadow control properties with design-time properties.
protected override void PreFilterProperties(IDictionary properties)
{
    // Call the base method first.
    base.PreFilterProperties(properties);

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

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

    ' Make the NamingContainer 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 .

Metoden PreFilterProperties tillämpar BrowsableAttribute attributet för RoleGroups egenskapen så att den inte visas i rutnätet Egenskaper .

Anteckningar till arvingar

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

Gäller för

Se även