TimeZoneEnumeration Constructor (NSInstance, String)
Creates and initializes an instance of the TimeZoneEnumeration class.
命名空間: Microsoft.SqlServer.NotificationServices
組件: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
語法
'宣告
Public Sub New ( _
nsInstance As NSInstance, _
language As String _
)
public TimeZoneEnumeration (
NSInstance nsInstance,
string language
)
public:
TimeZoneEnumeration (
NSInstance^ nsInstance,
String^ language
)
public TimeZoneEnumeration (
NSInstance nsInstance,
String language
)
public function TimeZoneEnumeration (
nsInstance : NSInstance,
language : String
)
參數
- nsInstance
An NSInstance representing the Notification Services instance that contains the collection of time zones.
- language
A String indicating the language in which the time zone data is to be returned.
範例
The following examples show how to create and initialize a TimeZoneEnumeration object in managed code:
Dim instanceName As String = "Tutorial"
' Create the NSInstance object.
Dim testInstance As NSInstance = _
New NSInstance(instanceName)
' Create the TimeZoneEnumeration.
Dim testTimeZoneEnumeration As TimeZoneEnumeration = _
New TimeZoneEnumeration(testInstance, _
System.Globalization.CultureInfo.CurrentUICulture.Parent.Name)
' Step through the enumeration, populating
' the drop-down list as you go. Note that the TimeZone
' reference must include the namespace, because there is
' an identically named class in the System namespace.
Dim thisTimeZone As _
Microsoft.SqlServer.NotificationServices.TimeZone
For Each thisTimeZone In testTimeZoneEnumeration
Console.WriteLine(thisTimeZone.TimeZoneName)
Next
string instanceName = "Tutorial";
// Create the NSInstance object.
NSInstance testInstance = new NSInstance(instanceName);
// Create the TimeZoneEnumeration.
TimeZoneEnumeration testTimeZoneEnumeration =
new TimeZoneEnumeration(testInstance,
System.Globalization.CultureInfo.CurrentUICulture.Parent.Name);
// Step through the enumeration, populating
// the drop-down list as you go. Note that the TimeZone
// reference must include the namespace, because there is
// an identically named class in the System namespace.
foreach(Microsoft.SqlServer.NotificationServices.TimeZone
thisTimeZone in testTimeZoneEnumeration)
{
Console.WriteLine(thisTimeZone.TimeZoneName);
}
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
TimeZoneEnumeration Class
TimeZoneEnumeration Members
Microsoft.SqlServer.NotificationServices Namespace