PropertyValueUIHandler 대리자

정의

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)

매개 변수

context
ITypeDescriptorContext

컨텍스트 정보를 얻는 데 사용할 수 있는 ITypeDescriptorContext입니다.

propDesc
PropertyDescriptor

쿼리되는 속성을 나타내는 PropertyDescriptor입니다.

valueUIItemList
ArrayList

속성과 관련된 UI 항목이 포함된 ArrayList 개체의 PropertyValueUIItem입니다.

예제

다음 코드 예제에서는 또는 라는 속성에 대 한 PropertyValueUIHandler 개체를 제공 PropertyValueUIItem 하는 이벤트 처리기 메서드를 만드는 방법을 보여 줍니다.HorizontalMarginVerticalMargin

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

설명

이 대리자를 호출하면 지정된 속성 ArrayList 에 대한 포함된 UI 항목을 매개 변수로 valueUIItemList 전달된 에 추가할 PropertyValueUIItem 수 있습니다.

확장 메서드

GetMethodInfo(Delegate)

지정된 대리자가 나타내는 메서드를 나타내는 개체를 가져옵니다.

적용 대상

추가 정보