Ejemplo n.º 1
0
 /// <summary>
 /// Returns an enumeration over system TimeZones with the given filter conditions.
 /// </summary>
 /// <param name="zoneType">The system time zone type.</param>
 /// <param name="region">The ISO 3166 two-letter country code or UN M.49 three-digit area code. When NULL, no filtering done by region.</param>
 /// <param name="zoneOffset">An offset from GMT in milliseconds, ignoring the effect of daylight savings time, if any. When NULL, no filtering done by zone offset.</param>
 public static IEnumerable <TimeZone> GetTimeZones(USystemTimeZoneType zoneType, string region, int zoneOffset)
 {
     return(CreateTimeZoneList(() =>
     {
         var en = NativeMethods.ucal_openTimeZoneIDEnumeration(zoneType, region, ref zoneOffset, out ErrorCode errorCode);
         return new Tuple <SafeEnumeratorHandle, ErrorCode>(en, errorCode);
     }));
 }