イベントへの参照を表します。
名前空間: System.CodeDom
アセンブリ: System (system.dll 内)
構文
'宣言
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class CodeEventReferenceExpression
Inherits CodeExpression
'使用
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
解説
CodeEventReferenceExpression を使用して、イベントへの参照を表すことができます。
TargetObject プロパティは、イベントを格納しているオブジェクトを指定します。EventName プロパティは、イベントの名前を指定します。
使用例
CodeEventReferenceExpression を使用して 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
// 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
継承階層
System.Object
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeEventReferenceExpression
スレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォーム
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0