PropertyValueUIItemInvokeHandler 代理人
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
InvokeHandler の PropertyValueUIItem イベントを処理するメソッドを表します。
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 デリゲートを作成する場合は、イベントを処理するメソッドを指定します。 イベント ハンドラーにイベントを関連付けるには、イベントにデリゲートのインスタンスを追加します。 イベント ハンドラーは、デリゲートを削除しない限り、イベントが発生するたびに呼び出されます。 イベント ハンドラー デリゲートの詳細については、「イベントの 処理と発生」を参照してください。
Get |
指定したデリゲートによって表されるメソッドを表すオブジェクトを取得します。 |
製品 | バージョン |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。