Esempio n. 1
0
 /// <summary>
 /// Adds the specified time zone to this time keeper
 /// </summary>
 /// <param name="timeZone"></param>
 public void AddTimeZone(DateTimeZone timeZone)
 {
     if (!_localTimeKeepers.ContainsKey(timeZone))
     {
         _localTimeKeepers[timeZone] = new LocalTimeKeeper(_utcDateTime, timeZone);
     }
 }
 /// <summary>
 /// Adds the specified time zone to this time keeper
 /// </summary>
 /// <param name="timeZone"></param>
 public void AddTimeZone(DateTimeZone timeZone)
 {
     if (!_localTimeKeepers.ContainsKey(timeZone))
     {
         _localTimeKeepers[timeZone] = new LocalTimeKeeper(_utcDateTime, timeZone);
     }
 }
        /// <summary>
        /// Gets the <see cref="LocalTimeKeeper"/> instance for the specified time zone
        /// </summary>
        /// <param name="timeZone">The time zone whose <see cref="LocalTimeKeeper"/> we seek</param>
        /// <returns>The <see cref="LocalTimeKeeper"/> instance for the specified time zone</returns>
        public LocalTimeKeeper GetLocalTimeKeeper(DateTimeZone timeZone)
        {
            LocalTimeKeeper localTimeKeeper;

            if (!_localTimeKeepers.TryGetValue(timeZone, out localTimeKeeper))
            {
                localTimeKeeper             = new LocalTimeKeeper(UtcTime, timeZone);
                _localTimeKeepers[timeZone] = localTimeKeeper;
            }
            return(localTimeKeeper);
        }
Esempio n. 4
0
 /// <summary>
 /// Gets the <see cref="LocalTimeKeeper"/> instance for the specified time zone
 /// </summary>
 /// <param name="timeZone">The time zone whose <see cref="LocalTimeKeeper"/> we seek</param>
 /// <returns>The <see cref="LocalTimeKeeper"/> instance for the specified time zone</returns>
 public LocalTimeKeeper GetLocalTimeKeeper(DateTimeZone timeZone)
 {
     LocalTimeKeeper localTimeKeeper;
     if (!_localTimeKeepers.TryGetValue(timeZone, out localTimeKeeper))
     {
         localTimeKeeper = new LocalTimeKeeper(UtcTime, timeZone);
         _localTimeKeepers[timeZone] = localTimeKeeper;
     }
     return localTimeKeeper;
 }