LoginDesigner.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

Följande kodexempel skapar en klass som härletts från LoginDesigneroch åsidosätter PreFilterProperties metoden för att ändra rutnätet Egenskaper för en Login kontroll 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)
{
    // 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 the 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 .

Om en LayoutTemplate egenskap har definierats för Login kontrollen anger PreFilterPropertiesBrowsableAttribute attributet för egenskaper som inte tillämpas när de mallas till så att false dessa egenskaper inte visas i rutnätet Egenskaper .

Anteckningar till arvingar

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

Gäller för

Se även