共用方式為


IEventProvider.Initialize Method

Initializes the event provider.

命名空間: Microsoft.SqlServer.NotificationServices
組件: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

語法

'宣告
Sub Initialize ( _
    nsApplication As NSApplication, _
    providerName As String, _
    args As StringDictionary, _
    stopDelegate As StopHandler _
)
void Initialize (
    NSApplication nsApplication,
    string providerName,
    StringDictionary args,
    StopHandler stopDelegate
)
void Initialize (
    NSApplication^ nsApplication, 
    String^ providerName, 
    StringDictionary^ args, 
    StopHandler^ stopDelegate
)
void Initialize (
    NSApplication nsApplication, 
    String providerName, 
    StringDictionary args, 
    StopHandler stopDelegate
)
function Initialize (
    nsApplication : NSApplication, 
    providerName : String, 
    args : StringDictionary, 
    stopDelegate : StopHandler
)

參數

  • nsApplication
    A NSApplication object representing the Notification Services application to which this event provider delivers events.
  • providerName
    A String containing the name of the event provider, as specified in the application definition
  • args
    A StringDictionary containing the names and values of the initialization arguments. This arguments are from the hosted event provider information in the application definition.
  • stopDelegate
    A StopHandler delegate that the event provider can use to call back to the provider host to request termination.

    Note that the event provider is not initialized until the Initialize method completes. Calling stopDelegate during initialization has no effect.

備註

The provider host calls this method to notify the continuous event provider that it must perform initialization. The args parameter provides the initialization arguments for the event provider. For more information about event provider arguments, see 定義裝載的事件提供者.

The Initialize method has a five-minute time-out window. If initialization has not completed within that time, an event is logged and the event provider's Terminate method is called.

You use the values provided in the args parameter to set class variables and prepare the event provider to run. This often involves setting information about the event source that the event provider monitors and the event class that defines the events that the event provider creates.

The Initialize method is called when the provider host starts running. The event provider performs initialization and returns as soon as initialization completes. The provider host always calls Initialize before calling the Run or Terminate method.

範例

For an example of how to implement the Initialize method, see the IEventProvider topic.

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

IEventProvider Interface
IEventProvider Members
Microsoft.SqlServer.NotificationServices Namespace