Compartir a través de


Subscription.Initialize Method

Initializes an instance of the Subscription class with a reference to an NSApplication and the name of a subscription class. Is used in conjunction with the parameterless constructor to enable COM interoperability.

Espacio de nombres: Microsoft.SqlServer.NotificationServices
Ensamblado: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Sintaxis

'Declaración
Public Sub Initialize ( _
    nsApplication As NSApplication, _
    subscriptionClassName As String _
)
public void Initialize (
    NSApplication nsApplication,
    string subscriptionClassName
)
public:
virtual void Initialize (
    NSApplication^ nsApplication, 
    String^ subscriptionClassName
) sealed
public final void Initialize (
    NSApplication nsApplication, 
    String subscriptionClassName
)
public final function Initialize (
    nsApplication : NSApplication, 
    subscriptionClassName : String
)

Parámetros

  • nsApplication
    An NSApplication representing the Notification Services application to which the Subscription object provides subscription data.
  • subscriptionClassName
    A string containing the name of the subscription class that defines the subscription data that the Subscription object provides. This determines what subscription fields this Subscription object exposes.

Notas

The Initialize method is used in conjunction with the parameterless constructor to enable COM interoperability. It must be called before any other property or method is called on a Subscription object created with the parameterless constructor.

Ejemplo

The following example shows how to create and initialize a Subscription in unmanaged Microsoft Visual Basic Scripting Edition (VBScript) code:

Dim testInstance, testApplication, testSubscription, subscriptionId

const instanceName = "Tutorial"
const applicationName = "Weather"
const subscriptionClassName = "WeatherCity"

' Create the NSInstance object.
set testInstance = WScript.CreateObject( _ 
    "Microsoft.SqlServer.NotificationServices.NSInstance")
testInstance.Initialize instanceName

' Create the NSApplication object.
set testApplication = WScript.CreateObject( _ 
    "Microsoft.SqlServer.NotificationServices.NSApplication")
testApplication.Initialize (testInstance), applicationName

' Create the Subscription object.
set testSubscription = WScript.CreateObject( _
    "Microsoft.SqlServer.NotificationServices.Subscription")
testSubscription.Initialize (testApplication), subscriptionClassName

Seguridad para subprocesos

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.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

Subscription Class
Subscription Members
Microsoft.SqlServer.NotificationServices Namespace