示例#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);
     }
 }
示例#2
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);
        }