PropertyValueUIItemInvokeHandler 代理人

定義

InvokeHandlerPropertyValueUIItem イベントを処理するメソッドを表します。

public delegate void PropertyValueUIItemInvokeHandler(ITypeDescriptorContext ^ context, PropertyDescriptor ^ descriptor, PropertyValueUIItem ^ invokedItem);
public delegate void PropertyValueUIItemInvokeHandler(ITypeDescriptorContext context, PropertyDescriptor descriptor, PropertyValueUIItem invokedItem);
type PropertyValueUIItemInvokeHandler = delegate of ITypeDescriptorContext * PropertyDescriptor * PropertyValueUIItem -> unit
Public Delegate Sub PropertyValueUIItemInvokeHandler(context As ITypeDescriptorContext, descriptor As PropertyDescriptor, invokedItem As PropertyValueUIItem)

パラメーター

context
ITypeDescriptorContext

ダブルクリックされたアイコンに関連付けられているプロパティの ITypeDescriptorContext

descriptor
PropertyDescriptor

ダブルクリックされたアイコンに関連付けられているプロパティ。

invokedItem
PropertyValueUIItem

ダブルクリックされたアイコンに関連付けられている PropertyValueUIItem

次のコード例では、 PropertyValueUIItem または VerticalMarginという名前HorizontalMarginのコンポーネントのプロパティの オブジェクトを提供します。 これらのプロパティの は PropertyValueUIItem 、イメージ、ツールヒント、およびプロパティのイメージがクリックされたときにメッセージ ボックスを表示するイベント ハンドラーを提供します。 このコード例は、 インターフェイス用に提供されるより大きな例の IPropertyValueUIService 一部です。

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

注釈

プロパティ ウィンドウのアイコンをダブルクリックすると、アイコンがInvokeHandler関連付けられている のPropertyValueUIItemイベントが発生します。 イベントは InvokeHandler 通常、プロパティの値を編集するためにユーザー インターフェイス (UI) を起動します。 PropertyValueUIItemInvokeHandlerの プロパティに をInvokeHandler追加して、プロパティ名のPropertyValueUIItem横に表示されるアイコンがダブルクリックされたときに適切な動作を実行するイベント ハンドラーを割り当てます。

PropertyValueUIItemInvokeHandler デリゲートを作成する場合は、イベントを処理するメソッドを指定します。 イベント ハンドラーにイベントを関連付けるには、イベントにデリゲートのインスタンスを追加します。 イベント ハンドラーは、デリゲートを削除しない限り、イベントが発生するたびに呼び出されます。 イベント ハンドラー デリゲートの詳細については、「イベントの 処理と発生」を参照してください。

拡張メソッド

GetMethodInfo(Delegate)

指定したデリゲートによって表されるメソッドを表すオブジェクトを取得します。

適用対象

こちらもご覧ください