Freigeben über


CodeEventReferenceExpression-Klasse

Stellt einen Verweis auf ein Ereignis dar.

Namespace: System.CodeDom
Assembly: System (in system.dll)

Syntax

'Declaration
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class CodeEventReferenceExpression
    Inherits CodeExpression
'Usage
Dim instance As CodeEventReferenceExpression
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
public class CodeEventReferenceExpression : CodeExpression
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
public ref class CodeEventReferenceExpression : public CodeExpression
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
public class CodeEventReferenceExpression extends CodeExpression
SerializableAttribute 
ComVisibleAttribute(true) 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
public class CodeEventReferenceExpression extends CodeExpression

Hinweise

Mit CodeEventReferenceExpression kann ein Verweis auf ein Ereignis dargestellt werden.

Die TargetObject-Eigenschaft gibt das Objekt an, das das Ereignis enthält. Die EventName-Eigenschaft gibt den Namen des Ereignisses an.

Beispiel

Im folgenden Beispiel wird veranschaulicht, wie mit einer CodeEventReferenceExpression auf ein Ereignis mit der Bezeichnung TestEvent verwiesen wird.

' Represents a reference to an event.
Dim eventRef1 As New CodeEventReferenceExpression(New CodeThisReferenceExpression(), "TestEvent")

' A Visual Basic code generator produces the following source code for the preceeding example code:

'       Me.TestEvent
// Represents a reference to an event.
CodeEventReferenceExpression eventRef1 = new CodeEventReferenceExpression( new CodeThisReferenceExpression(), "TestEvent" );

// A C# code generator produces the following source code for the preceeding example code:

//        this.TestEvent
// Represents a reference to an event.
CodeEventReferenceExpression^ eventRef1 = gcnew CodeEventReferenceExpression( gcnew CodeThisReferenceExpression,"TestEvent" );

// A C# code generator produces the following source code for the preceeding example code:
//        this.TestEvent
// Represents a reference to an event.
CodeEventReferenceExpression eventRef1 = new 
    CodeEventReferenceExpression(new CodeThisReferenceExpression(),
    "TestEvent");
// A VJ# code generator produces the following source code for the
// preceeding example code:
// this.TestEvent

Vererbungshierarchie

System.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeExpression
      System.CodeDom.CodeEventReferenceExpression

Threadsicherheit

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

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

CodeEventReferenceExpression-Member
System.CodeDom-Namespace