Initializes a new instance of the WmiEventWatcherTask class.
Assembly: Microsoft.SqlServer.WMIEWTask (in Microsoft.SqlServer.WMIEWTask.dll)
The code sample shows how to call the task constructor. However, in most cases, you will be creating the task as a member of a package. For more information on casting the task, see the remarks in Add.
Dim pkg As Package = New Package() Dim exec1 As Executable = pkg.Executables.Add("STOCK:WmiEventWatcherTask") Dim th As TaskHost = exec1 as TaskHost ' You can cast the InnerObject of the TaskHost ' to the specific class. ' For the code samples, that task properties are accessed using ' the Properties of the TaskHost. ' Dim myTask As WmiEventWatcherTask = th.InnerObject as WmiEventWatcherTask