다음을 통해 공유


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