다음을 통해 공유


TypeBuilder.DefineEvent 메서드

지정된 이름, 특성 및 이벤트 형식을 사용하여 형식에 새 이벤트를 추가합니다.

네임스페이스: System.Reflection.Emit
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Function DefineEvent ( _
    name As String, _
    attributes As EventAttributes, _
    eventtype As Type _
) As EventBuilder
‘사용 방법
Dim instance As TypeBuilder
Dim name As String
Dim attributes As EventAttributes
Dim eventtype As Type
Dim returnValue As EventBuilder

returnValue = instance.DefineEvent(name, attributes, eventtype)
public EventBuilder DefineEvent (
    string name,
    EventAttributes attributes,
    Type eventtype
)
public:
EventBuilder^ DefineEvent (
    String^ name, 
    EventAttributes attributes, 
    Type^ eventtype
)
public EventBuilder DefineEvent (
    String name, 
    EventAttributes attributes, 
    Type eventtype
)
public function DefineEvent (
    name : String, 
    attributes : EventAttributes, 
    eventtype : Type
) : EventBuilder

매개 변수

  • name
    이벤트의 이름입니다. name은 null을 포함할 수 없습니다.
  • attributes
    이벤트의 특성입니다.
  • eventtype
    이벤트의 형식입니다.

반환 값

정의된 이벤트입니다.

예외

예외 형식 조건

ArgumentException

name의 길이가 0인 경우

ArgumentNullException

name이 Null 참조(Visual Basic의 경우 Nothing)인 경우

- 또는 -

eventtype이 Null 참조(Visual Basic의 경우 Nothing)인 경우

InvalidOperationException

해당 형식이 CreateType을 사용하여 이미 만들어져 있는 경우

플랫폼

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에서 지원

참고 항목

참조

TypeBuilder 클래스
TypeBuilder 멤버
System.Reflection.Emit 네임스페이스