ComponentDesigner.InvokeGetInheritanceAttribute-Methode
Ruft das InheritanceAttribute des angegebenen ComponentDesigner ab.
Namespace: System.ComponentModel.Design
Assembly: System.Design (in system.design.dll)
Syntax
'Declaration
Protected Function InvokeGetInheritanceAttribute ( _
toInvoke As ComponentDesigner _
) As InheritanceAttribute
'Usage
Dim toInvoke As ComponentDesigner
Dim returnValue As InheritanceAttribute
returnValue = Me.InvokeGetInheritanceAttribute(toInvoke)
protected InheritanceAttribute InvokeGetInheritanceAttribute (
ComponentDesigner toInvoke
)
protected:
InheritanceAttribute^ InvokeGetInheritanceAttribute (
ComponentDesigner^ toInvoke
)
protected InheritanceAttribute InvokeGetInheritanceAttribute (
ComponentDesigner toInvoke
)
protected function InvokeGetInheritanceAttribute (
toInvoke : ComponentDesigner
) : InheritanceAttribute
Parameter
- toInvoke
Der ComponentDesigner, dessen Vererbungsattribut abgerufen werden soll.
Rückgabewert
Das InheritanceAttribute des angegebenen Designers.
Beispiel
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
_
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
{
}
public ref class DesignerSample: public ComponentDesigner
{
public:
property DesignerVerbCollection^ Verbs
{
virtual DesignerVerbCollection^ get() override
{
// Specifies a new verb that will show up in the shortcut menu for the component.
DesignerVerb^ clickVerb = gcnew DesignerVerb( "Click Me!",gcnew EventHandler( this, &DesignerSample::OnVerbClicked ) );
array<DesignerVerb^>^myArray = {clickVerb};
return gcnew DesignerVerbCollection( myArray );
}
}
private:
void OnVerbClicked( Object^ /*sender*/, EventArgs^ /*e*/ )
{
MessageBox::Show( "This verb was clicked" );
}
};
...
[Designer(DesignerSample::typeid)]
public ref class DesignerComponent: public Component{};
public class DesignerSample
extends ComponentDesigner
{
/** @property
*/
public DesignerVerbCollection get_Verbs()
{
// 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 });
} //get_Verbs
private void OnVerbClicked(Object sender, EventArgs e)
{
MessageBox.Show("This verb was clicked");
} //OnVerbClicked
} //DesignerSample
...
/** @attribute Designer(DesignerSample.class)
*/
public class DesignerComponent extends Component
{
} //DesignerComponent
.NET Framework-Sicherheit
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ComponentDesigner-Klasse
ComponentDesigner-Member
System.ComponentModel.Design-Namespace