PropertyValueUIHandler Delegate

Represents the method that adds a delegate to an implementation of IPropertyValueUIService.

Namespace:  System.Drawing.Design
Assembly:  System.Drawing (in System.Drawing.dll)

public delegate void PropertyValueUIHandler(
	ITypeDescriptorContext context,
	PropertyDescriptor propDesc,
	ArrayList valueUIItemList
)

Parameters

context
Type: System.ComponentModel.ITypeDescriptorContext

An ITypeDescriptorContext that can be used to obtain context information.

propDesc
Type: System.ComponentModel.PropertyDescriptor

A PropertyDescriptor that represents the property being queried.

valueUIItemList
Type: System.Collections.ArrayList

An ArrayList of PropertyValueUIItem objects containing the UI items associated with the property.

When this delegate is invoked, it can add a PropertyValueUIItem containing UI items for the specified property to the ArrayList passed as the valueUIItemList parameter.

This following code example demonstrates creating a PropertyValueUIHandler event handler method that provides PropertyValueUIItem objects for any properties named HorizontalMargin or 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 = DeserializeFromBase64Text(imageBlob1);
        itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") );
    }
    if( propDesc.DisplayName.Equals( "VerticalMargin" ) )
    {
        Image img = DeserializeFromBase64Text(imageBlob1);
        img.RotateFlip(RotateFlipType.Rotate90FlipNone);
        itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") );
    }
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft