コード例 #1
0
        internal static ExTimeZone PromoteCustomizedTimeZone(ExTimeZone customizedTimeZone)
        {
            ExTimeZone exTimeZone = null;

            if (customizedTimeZone.IsCustomTimeZone && !ExTimeZoneEnumerator.Instance.TryGetTimeZoneByName(customizedTimeZone.AlternativeId, out exTimeZone))
            {
                string            displayName = customizedTimeZone.LocalizableDisplayName.ToString();
                List <ExTimeZone> list        = TimeZoneHelper.MatchCustomTimeZoneByEffectiveRule(customizedTimeZone);
                exTimeZone = TimeZoneHelper.GetUniqueTimeZoneMatch(list, displayName);
                if (exTimeZone == null && list.Count > 1)
                {
                    List <ExTimeZone> timeZones = TimeZoneHelper.MatchCustomTimeZoneByRules(customizedTimeZone, list);
                    exTimeZone = TimeZoneHelper.GetUniqueTimeZoneMatch(timeZones, displayName);
                }
            }
            return(exTimeZone);
        }