PropertyValueUIHandler Delegado

Definición

Representa el método que agrega un delegado a una implementación 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)

Parámetros

context
ITypeDescriptorContext

Un objeto ITypeDescriptorContext que se puede utilizar para obtener información sobre el contexto.

propDesc
PropertyDescriptor

Un objeto PropertyDescriptor que representa la propiedad que se consulta.

valueUIItemList
ArrayList

Una colección ArrayList de objetos PropertyValueUIItem incluidos en los elementos de interfaz de usuario asociados a la propiedad.

Ejemplos

En este ejemplo de código siguiente se muestra cómo crear un PropertyValueUIHandler método de controlador de eventos que proporciona PropertyValueUIItem objetos para cualquier propiedad denominada 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"));
    }
}

Comentarios

Cuando se invoca a este delegado, puede agregar un PropertyValueUIItem elemento de interfaz de usuario contenedor para la propiedad especificada al ArrayList parámetro pasado valueUIItemList .

Métodos de extensión

GetMethodInfo(Delegate)

Obtiene un objeto que representa el método representado por el delegado especificado.

Se aplica a

Consulte también