ComponentDesigner.InvokeGetInheritanceAttribute メソッド
指定した ComponentDesigner の InheritanceAttribute を取得します。
Protected Function InvokeGetInheritanceAttribute( _
ByVal toInvoke As ComponentDesigner _) As InheritanceAttribute
[C#]
protected InheritanceAttribute InvokeGetInheritanceAttribute(ComponentDesignertoInvoke);
[C++]
protected: InheritanceAttribute* InvokeGetInheritanceAttribute(ComponentDesigner* toInvoke);
[JScript]
protected function InvokeGetInheritanceAttribute(
toInvoke : ComponentDesigner) : InheritanceAttribute;
パラメータ
- toInvoke
継承属性を取得する対象の ComponentDesigner 。
戻り値
指定したデザイナの InheritanceAttribute 。
使用例
Public Class DesignerSample
Inherits ComponentDesigner
Public Overrides ReadOnly Property Verbs() As DesignerVerbCollection
Get
' Specifies a new verb that will show up in the context menu for the component.
Dim clickVerb As New DesignerVerb("Click Me!", New EventHandler(AddressOf OnVerbClicked))
Return New DesignerVerbCollection(New DesignerVerb() {clickVerb})
End Get
End Property
Private Sub OnVerbClicked(sender As Object, e As EventArgs)
MessageBox.Show("This verb was clicked")
End Sub 'OnVerbClicked
End Class 'DesignerSample
. . .
<Designer(GetType(DesignerSample))> _
Public Class DesignerComponent
Inherits Component
End Class 'DesignerComponent
_
[C#]
public class DesignerSample : ComponentDesigner
{
public override DesignerVerbCollection Verbs
{
get
{
// Specifies a new verb that will show up in the shortcut menu for the component.
DesignerVerb clickVerb = new DesignerVerb("Click Me!", new EventHandler(OnVerbClicked));
return new DesignerVerbCollection(new DesignerVerb[] {clickVerb});
}
}
private void OnVerbClicked(object sender, EventArgs e)
{
MessageBox.Show("This verb was clicked");
}
}
. . .
[Designer(typeof(DesignerSample))]
public class DesignerComponent : Component
{
}
[C++]
public __gc class DesignerSample : public ComponentDesigner {
public:
__property DesignerVerbCollection* get_Verbs()
{
// Specifies a new verb that will show up in the shortcut menu for the component.
DesignerVerb* clickVerb = new DesignerVerb(S"Click Me!", new EventHandler(this, &DesignerSample::OnVerbClicked));
DesignerVerb* myArray[] = {clickVerb};
return new DesignerVerbCollection(myArray);
}
private:
void OnVerbClicked(Object* /*sender*/, EventArgs* /*e*/)
{
MessageBox::Show(S"This verb was clicked");
}
};
. . .
[Designer(__typeof(DesignerSample))]
public __gc class DesignerComponent : public Component
{
};
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
ComponentDesigner クラス | ComponentDesigner メンバ | System.ComponentModel.Design 名前空間