EventInfos.Add 메서드

정의

현재 EventInfo 컬렉션에 EventInfos 개체를 추가합니다.

public:
 void Add(System::String ^ eventName, System::String ^ description, bool allowEventHandlers, cli::array <System::String ^> ^ parameterNames, cli::array <TypeCode> ^ parameterTypes, cli::array <System::String ^> ^ parameterDescriptions);
public void Add (string eventName, string description, bool allowEventHandlers, string[] parameterNames, TypeCode[] parameterTypes, string[] parameterDescriptions);
member this.Add : string * string * bool * string[] * TypeCode[] * string[] -> unit
Public Sub Add (eventName As String, description As String, allowEventHandlers As Boolean, parameterNames As String(), parameterTypes As TypeCode(), parameterDescriptions As String())

매개 변수

eventName
String

사용자 지정 이벤트의 이름입니다.

description
String

이벤트에 대한 설명을 포함하는 문자열입니다.

allowEventHandlers
Boolean

개발 도구에서 이벤트에 대해 이벤트 처리기 개체를 만들 수 있는지 여부를 나타내는 부울입니다. true이면 이벤트에 대한 이벤트 처리기 개체를 만들 수 있습니다.

parameterNames
String[]

이벤트에 전달되는 매개 변수로 이루어진 배열입니다.

parameterTypes
TypeCode[]

parameterNames 배열에 속한 각 매개 변수의 유형입니다.

parameterDescriptions
String[]

parameterNames의 각 매개 변수에 대한 설명이 포함된 배열입니다.

예제

다음 예제에서는 컬렉션에 추가 EventInfos 되는 사용자 지정 이벤트를 보여줍니다.

public override void InitializeTask(Connections connections, VariableDispenser variables, IDTSInfoEvents events, IDTSLogging log, EventInfos eventInfos, LogEntryInfos logEntryInfos, ObjectReferenceTracker refTracker)  
{  
    this.eventInfos = eventInfos;  
    string[] paramNames = new string[1];  
    TypeCode[] paramTypes = new TypeCode[1]{TypeCode.Int32};  
    string[] paramDescriptions = new string[1];  

    paramNames[0] = "InitialValue";  
    paramDescriptions[0] = "The value before increment.";  

    this.eventInfos.Add("OnBeforeIncrement","Fires before the task increments the value.",true,paramNames,paramTypes,paramDescriptions);  
    this.onBeforeIncrement = this.eventInfos["OnBeforeIncrement"];  

    paramDescriptions[0] = "The value after increment.";  
    this.eventInfos.Add("OnAfterIncrement","Fires after the initial value is updated.",true,paramNames, paramTypes,paramDescriptions);  
    this.onAfterIncrement = this.eventInfos["OnAfterIncrement"];  
}  
Public Overrides Sub InitializeTask(ByVal connections As Connections, ByVal variables As VariableDispenser, ByVal events As IDTSInfoEvents, ByVal log As IDTSLogging, ByVal eventInfos As EventInfos, ByVal logEntryInfos As LogEntryInfos, ByVal refTracker As ObjectReferenceTracker)   
    Me.eventInfos = eventInfos  
    Dim paramNames(0) As String  
    Dim paramTypes(0) As TypeCode = {TypeCode.Int32}  
    Dim paramDescriptions(0) As String  

    paramNames(0) = "InitialValue"  
    paramDescriptions(0) = "The value before increment."  

    Me.eventInfos.Add("OnBeforeIncrement", "Fires before the task increments the value.", True, paramNames, paramTypes, paramDescriptions)  
    Me.onBeforeIncrement = Me.eventInfos("OnBeforeIncrement")  

    paramDescriptions(0) = "The value after increment."  
    Me.eventInfos.Add("OnAfterIncrement", "Fires after the initial value is updated.", True, paramNames, paramTypes, paramDescriptions)  
    Me.onAfterIncrement = Me.eventInfos("OnAfterIncrement")  
End Sub  

설명

컬렉션 및 메서드의 EventInfos 예는 Add사용자 지정 작업 개발을 참조하세요.

적용 대상