PropertyValueUIHandler Delegato
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Rappresenta il metodo che aggiunge un delegato a un'implementazione di IPropertyValueUIService.
public delegate void PropertyValueUIHandler(ITypeDescriptorContext ^ context, PropertyDescriptor ^ propDesc, ArrayList ^ valueUIItemList);
public delegate void PropertyValueUIHandler(ITypeDescriptorContext context, PropertyDescriptor propDesc, ArrayList valueUIItemList);
type PropertyValueUIHandler = delegate of ITypeDescriptorContext * PropertyDescriptor * ArrayList -> unit
Public Delegate Sub PropertyValueUIHandler(context As ITypeDescriptorContext, propDesc As PropertyDescriptor, valueUIItemList As ArrayList)
Parametri
- context
- ITypeDescriptorContext
Oggetto ITypeDescriptorContext che può essere utilizzato per ottenere informazioni di contesto.
- propDesc
- PropertyDescriptor
Oggetto PropertyDescriptor che rappresenta la proprietà sottoposta a query.
- valueUIItemList
- ArrayList
Oggetto ArrayList di PropertyValueUIItem oggetti contenenti gli elementi dell'interfaccia utente associati alla proprietà .
Esempio
Questo esempio di codice seguente illustra la creazione di un PropertyValueUIHandler metodo del gestore eventi che fornisce PropertyValueUIItem oggetti per qualsiasi proprietà denominata HorizontalMargin o VerticalMargin.
// PropertyValueUIHandler delegate that provides PropertyValueUIItem
// objects to any properties named HorizontalMargin or VerticalMargin.
private void marginPropertyValueUIHandler(
System.ComponentModel.ITypeDescriptorContext context,
System.ComponentModel.PropertyDescriptor propDesc,
ArrayList itemList)
{
// A PropertyValueUIHandler added to the IPropertyValueUIService
// is queried once for each property of a component and passed
// a PropertyDescriptor that represents the characteristics of
// the property when the Properties window is set to a new
// component. A PropertyValueUIHandler can determine whether
// to add a PropertyValueUIItem for the object to its ValueUIItem
// list depending on the values of the PropertyDescriptor.
if (propDesc.DisplayName.Equals("HorizontalMargin"))
{
Image img = Image.FromFile("SampImag.jpg");
itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
}
if (propDesc.DisplayName.Equals("VerticalMargin"))
{
Image img = Image.FromFile("SampImag.jpg");
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
}
}
Commenti
Quando questo delegato viene richiamato, può aggiungere un PropertyValueUIItem oggetto contenente elementi dell'interfaccia utente per la proprietà specificata all'oggetto ArrayList passato come valueUIItemList parametro.
Metodi di estensione
| Nome | Descrizione |
|---|---|
| GetMethodInfo(Delegate) |
Ottiene un oggetto che rappresenta il metodo rappresentato dal delegato specificato. |