PropertyValueUIHandler Délégué

Définition

Représente la méthode qui ajoute un délégué à une implémentation de 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)

Paramètres

context
ITypeDescriptorContext

Qui ITypeDescriptorContext peut être utilisé pour obtenir des informations de contexte.

propDesc
PropertyDescriptor

Qui PropertyDescriptor représente la propriété interrogée.

valueUIItemList
ArrayList

Objet ArrayList contenant les éléments d’interface PropertyValueUIItem utilisateur associés à la propriété.

Exemples

Cet exemple de code suivant illustre la création d’une méthode de gestionnaire d’événements PropertyValueUIHandler qui fournit des PropertyValueUIItem objets pour toutes les propriétés nommées HorizontalMargin ou 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"));
    }
}

Remarques

Lorsque ce délégué est appelé, il peut ajouter un PropertyValueUIItem élément d’interface utilisateur contenant la propriété spécifiée au ArrayList paramètre passé valueUIItemList .

Méthodes d’extension

Nom Description
GetMethodInfo(Delegate)

Obtient un objet qui représente la méthode représentée par le délégué spécifié.

S’applique à

Voir aussi