Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

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
)
/** @delegate */
public delegate void PropertyValueUIHandler (
	ITypeDescriptorContext context, 
	PropertyDescriptor propDesc, 
	ArrayList valueUIItemList
)
Not applicable.

Parameters

context

An ITypeDescriptorContext that can be used to obtain context information.

propDesc

A PropertyDescriptor that represents the property being queried.

valueUIItemList

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") );
    }
}

// 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.get_DisplayName().Equals("HorizontalMargin")) {
        Image img = DeserializeFromBase64Text(imageBlob1);

        itemList.Add(new PropertyValueUIItem(img, 
            new PropertyValueUIItemInvokeHandler(this.MarginInvoke),
            "Test ToolTip"));
    }
    if (propDesc.get_DisplayName().Equals("VerticalMargin")) {
        Image img = DeserializeFromBase64Text(imageBlob1);

        img.RotateFlip(RotateFlipType.Rotate90FlipNone);
        itemList.Add(new PropertyValueUIItem(img, 
            new PropertyValueUIItemInvokeHandler(this.MarginInvoke),
            "Test ToolTip"));
    }
} //MarginPropertyValueUIHandler

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.