CodeEventReferenceExpression Klasa

Definicja

Reprezentuje odwołanie do zdarzenia.

public ref class CodeEventReferenceExpression : System::CodeDom::CodeExpression
public class CodeEventReferenceExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeEventReferenceExpression : System.CodeDom.CodeExpression
type CodeEventReferenceExpression = class
    inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeEventReferenceExpression = class
    inherit CodeExpression
Public Class CodeEventReferenceExpression
Inherits CodeExpression
Dziedziczenie
CodeEventReferenceExpression
Atrybuty

Przykłady

W poniższym przykładzie pokazano użycie metody CodeEventReferenceExpression , aby odwołać się do zdarzenia o nazwie 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 C# code generator produces the following source code for the preceeding example code:

//        this.TestEvent
' 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

Uwagi

CodeEventReferenceExpression może służyć do reprezentowania odwołania do zdarzenia.

Właściwość TargetObject określa obiekt, który zawiera zdarzenie. Właściwość EventName określa nazwę zdarzenia.

Konstruktory

CodeEventReferenceExpression()

Inicjuje nowe wystąpienie klasy CodeEventReferenceExpression.

CodeEventReferenceExpression(CodeExpression, String)

Inicjuje CodeEventReferenceExpression nowe wystąpienie klasy przy użyciu określonego obiektu docelowego i nazwy zdarzenia.

Właściwości

EventName

Pobiera lub ustawia nazwę zdarzenia.

TargetObject

Pobiera lub ustawia obiekt zawierający zdarzenie.

UserData

Pobiera dane, które można definiować przez użytkownika dla bieżącego obiektu.

(Odziedziczone po CodeObject)

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy