AccessDataSourceDesigner.PreFilterProperties(IDictionary) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Används av designern för att lägga till egenskaper i, eller ta bort dem från, 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 för att göra ConnectionString egenskapen skrivskyddad och synlig i rutnätet Egenskaper .
Det här kodexemplet är en del av ett större exempel för AccessDataSourceDesigner klassen.
// Shadow control properties with design time properties.
protected override void PreFilterProperties(IDictionary properties)
{
// Call the base class method first.
base.PreFilterProperties(properties);
// Add the ConnectionString property to the property grid.
PropertyDescriptor property =
(PropertyDescriptor)properties["ConnectionString"];
Attribute[] attributes = new Attribute[]
{
new BrowsableAttribute(true),
new ReadOnlyAttribute(true)
};
properties["ConnectionString"] = TypeDescriptor.CreateProperty(
GetType(), property, attributes);
}
' Shadow control properties with design time properties.
Protected Overrides Sub PreFilterProperties(ByVal properties As IDictionary)
' Call the base class method first.
MyBase.PreFilterProperties(properties)
' Add the ConnectionString property to the property grid.
Dim prop As PropertyDescriptor
prop = CType(properties("ConnectionString"), PropertyDescriptor)
Dim atts(1) As Attribute
atts(0) = New BrowsableAttribute(True)
atts(1) = New ReadOnlyAttribute(True)
properties("ConnectionString") = TypeDescriptor.CreateProperty( _
prop.GetType(), prop, atts)
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 dem från rutnätet Egenskaper .
AccessDataSource För kontrollen PreFilterProperties skapar metoden egenskapen design-time DataFile för att skugga DataFile kontrollens egenskap.
Anteckningar till arvingar
Åsidosätt PreFilterProperties(IDictionary) metoden för att lägga till egenskaper i egenskapssamlingen design-time eller ändra deras attribut. Var noga med att anropa basmetoden innan du utför annan bearbetning.