HostedEventProvider.ClassName Property
Gets or sets the name of the class that implements the custom event provider.
命名空间: Microsoft.SqlServer.Management.Nmo
程序集: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
语法
声明
Public Property ClassName As String
public string ClassName { get; set; }
public:
property String^ ClassName {
String^ get ();
void set (String^ value);
}
/** @property */
public String get_ClassName ()
/** @property */
public void set_ClassName (String value)
public function get ClassName () : String
public function set ClassName (value : String)
属性值
A String, between 1 and 512 characters in length, that specifies the name of the class that implements the custom event provider.
备注
For standard event provider class names, see 标准事件提供程序.
For custom event providers, fully specify the class name. If the class is in a namespace, include the namespace.
For more information about class naming guidelines, see Class Naming Guidelines at MSDN Online.
示例
The following examples show how to define a hosted event provider, including the class name:
// Define a hosted event provider
HostedEventProvider flightEventProvider =
new HostedEventProvider(myApplication, "FlightEP");
flightEventProvider.ClassName = "FileSystemWatcherProvider";
flightEventProvider.SystemName = notificationServicesHost;
// Define event provider arguments
HostedEventProviderArgument fileArg_Directory =
new HostedEventProviderArgument(
flightEventProvider, "WatchDirectory");
fileArg_Directory.Value = sampleDirectory + @"\Events";
flightEventProvider.HostedEventProviderArguments.Add(
fileArg_Directory);
HostedEventProviderArgument fileArg_Schema =
new HostedEventProviderArgument(
flightEventProvider, "SchemaFile");
fileArg_Schema.Value = sampleDirectory +
@"\AppDefinition\EventsSchema.xsd";
flightEventProvider.HostedEventProviderArguments.Add(
fileArg_Schema);
HostedEventProviderArgument fileArg_EventClass =
new HostedEventProviderArgument(flightEventProvider,
"EventClassName");
fileArg_EventClass.Value = "FlightEvents";
flightEventProvider.HostedEventProviderArguments.Add(
fileArg_EventClass);
myApplication.HostedEventProviders.Add(flightEventProvider);
' Define a hosted event provider
Dim flightEventProvider As HostedEventProvider = _
New HostedEventProvider(myApplication, "FlightEP")
flightEventProvider.ClassName = "FileSystemWatcherProvider"
flightEventProvider.SystemName = notificationServicesHost
' Define event provider arguments
Dim fileArg_Directory As HostedEventProviderArgument = _
New HostedEventProviderArgument(flightEventProvider, _
"WatchDirectory")
fileArg_Directory.Value = sampleDirectory + "\Events"
flightEventProvider.HostedEventProviderArguments.Add( _
fileArg_Directory)
Dim fileArg_Schema As HostedEventProviderArgument = _
New HostedEventProviderArgument(flightEventProvider, _
"SchemaFile")
fileArg_Schema.Value = sampleDirectory + _
"\AppDefinition\EventsSchema.xsd"
flightEventProvider.HostedEventProviderArguments.Add( _
fileArg_Schema)
Dim fileArg_EventClass As HostedEventProviderArgument = _
New HostedEventProviderArgument(flightEventProvider, _
"EventClassName")
fileArg_EventClass.Value = "FlightEvents"
flightEventProvider.HostedEventProviderArguments.Add( _
fileArg_EventClass)
myApplication.HostedEventProviders.Add(flightEventProvider)
线程安全
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 的硬件和软件要求。
请参阅
参考
HostedEventProvider Class
HostedEventProvider Members
Microsoft.SqlServer.Management.Nmo Namespace