CodeEventReferenceExpression Osztály

Definíció

Eseményre mutató hivatkozást jelöl.

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
Öröklődés
CodeEventReferenceExpression
Attribútumok

Példák

Az alábbi példa egy TestEvent nevű eseményre való hivatkozás használatát CodeEventReferenceExpression mutatja be.

// 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

Megjegyzések

CodeEventReferenceExpression egy eseményre mutató hivatkozás ábrázolására használható.

A TargetObject tulajdonság megadja az eseményt tartalmazó objektumot. A EventName tulajdonság az esemény nevét adja meg.

Konstruktorok

Name Description
CodeEventReferenceExpression()

Inicializálja a CodeEventReferenceExpression osztály új példányát.

CodeEventReferenceExpression(CodeExpression, String)

Inicializálja az osztály új példányát a CodeEventReferenceExpression megadott célobjektum és eseménynév használatával.

Tulajdonságok

Name Description
EventName

Lekéri vagy beállítja az esemény nevét.

TargetObject

Lekéri vagy beállítja az eseményt tartalmazó objektumot.

UserData

Lekéri az aktuális objektum felhasználó által definiálható adatait.

(Öröklődés forrása CodeObject)

Metódusok

Name Description
Equals(Object)

Meghatározza, hogy a megadott objektum egyenlő-e az aktuális objektummal.

(Öröklődés forrása Object)
GetHashCode()

Ez az alapértelmezett kivonatoló függvény.

(Öröklődés forrása Object)
GetType()

Lekéri az Type aktuális példányt.

(Öröklődés forrása Object)
MemberwiseClone()

Az aktuális Objectpéldány sekély másolatát hozza létre.

(Öröklődés forrása Object)
ToString()

Az aktuális objektumot jelképező sztringet ad vissza.

(Öröklődés forrása Object)

A következőre érvényes: