Freigeben über


Event Constructor (NSApplication, String)

Creates and initializes an instance of the Event class.

Namespace: Microsoft.SqlServer.NotificationServices
Assembly : Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Syntax

'Declaration
Public Sub New ( _
    nsApplication As NSApplication, _
    eventClassName As String _
)
public Event (
    NSApplication nsApplication,
    string eventClassName
)
public:
Event (
    NSApplication^ nsApplication, 
    String^ eventClassName
)
public Event (
    NSApplication nsApplication, 
    String eventClassName
)
public function Event (
    nsApplication : NSApplication, 
    eventClassName : String
)

Parameter

  • nsApplication
    An NSApplication that represents the Notification Services application for the event.
  • eventClassName
    A String containing the name of the event class of the Event.

Hinweise

It is possible to construct an Event without initializing it with an NSApplication. In this case, the event class is not verified, and event field names must be hard-coded. This can be useful in cases where you would like to use an Event in an application that does not have a direct connection to a Notification Services server, for example in a disconnected Message Queuing (also known as MSMQ) scenario. For more information about using an Event in this way, see Verwenden der verwalteten Ereignisübermittlungs-API.

Beispiel

The following examples show how to create and initialize an Event in managed code.

These examples use the Microsoft.SqlServer.NotificationServices namespace.

Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim eventClassName As String = "MyEventClassName"

'Create an NSInstance object.
Dim myInstance As New NSInstance(instanceName)

'Create an NSApplication object.
Dim myApplication As New NSApplication(myInstance, applicationName)

'Create an Event object.
Dim myEvent As New Microsoft.SqlServer.NotificationServices.Event( _
    myApplication, eventClassName)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string eventClassName = "MyEventClassName";

//Create an NSInstance object.
NSInstance myInstance = new NSInstance(instanceName);

//Create an NSApplication object.
NSApplication myApplication = 
    new NSApplication(myInstance, applicationName);

//Create an Event object.
Event myEvent = new Event(myApplication, eventClassName);

Plattformen

Entwicklungsplattformen

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Zielplattforme

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Siehe auch

Verweis

Event Class
Event Members
Microsoft.SqlServer.NotificationServices Namespace