PropertyValueUIHandler Temsilci

Tanım

uygulamasına IPropertyValueUIServicetemsilci ekleyen yöntemi temsil eder.

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)

Parametreler

context
ITypeDescriptorContext

ITypeDescriptorContext Bağlam bilgilerini almak için kullanılabilecek bir.

propDesc
PropertyDescriptor

PropertyDescriptor Sorgulanan özelliği temsil eden bir.

valueUIItemList
ArrayList

ArrayListPropertyValueUIItem özelliğiyle ilişkilendirilmiş kullanıcı arabirimi öğelerini içeren nesnelerden biri.

Örnekler

Bu aşağıdaki kod örneği, veya VerticalMarginadlı HorizontalMargin özellikler için nesneler sağlayan PropertyValueUIItem bir PropertyValueUIHandler olay işleyicisi yöntemi oluşturmayı gösterir.

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

Açıklamalar

Bu temsilci çağrıldığında, parametre olarak valueUIItemList geçirilen öğesine belirtilen özellik ArrayList için bir içeren kullanıcı arabirimi öğeleri ekleyebilirPropertyValueUIItem.

Uzantı Metotları

GetMethodInfo(Delegate)

Belirtilen temsilci tarafından temsil edilen yöntemi temsil eden bir nesnesi alır.

Şunlara uygulanır

Ayrıca bkz.