Exemplo n.º 1
0
 public ExtendedFormatTime(string timeFormat)
 {
     if (string.IsNullOrEmpty(timeFormat))
     {
         throw new ArgumentException(Resources.ExceptionNullTimeFormat, "timeFormat");
     }
     ExtendedFormat.Validate(timeFormat);
     this.extendedFormat = timeFormat;
     this.lastUsedTime   = DateTime.Now.ToUniversalTime();
 }
Exemplo n.º 2
0
        /// <summary>
        ///	Convert the input format to the extented time format.
        /// </summary>
        /// <param name="timeFormat">
        ///	This contains the expiration information
        /// </param>
        public ExtendedFormatTime(string timeFormat)
        {
            // check arguments
            if (string.IsNullOrEmpty(timeFormat))
            {
                throw new ArgumentException(Resources.ExceptionNullTimeFormat, "timeFormat");
            }

            ExtendedFormat.Validate(timeFormat);

            // Get the modified extended format
            this.extendedFormat = timeFormat;

            // Convert to UTC in order to compensate for time zones
            this.lastUsedTime = DateTime.Now.ToUniversalTime();
        }
Exemplo n.º 3
0
        /// <summary>
        ///	Convert the input format to the extented time format.
        /// </summary>
        /// <param name="timeFormat">
        ///	This contains the expiration information
        /// </param>
        public ExtendedFormatTime(string timeFormat)
        {
            // check arguments
            if (Object.Equals(timeFormat, null))
            {
                throw new ArgumentNullException("timeFormat",
                                                SR.ExceptionNullTimeFormat);
            }
            if (timeFormat.Length == 0)
            {
                throw new ArgumentOutOfRangeException("timeFormat",
                                                      SR.ExceptionRangeTimeFormat);
            }

            ExtendedFormat.Validate(timeFormat);

            // Get the modified extended format
            this.extendedFormat = timeFormat;

            // Convert to UTC in order to compensate for time zones
            this.lastUsedTime = DateTime.Now.ToUniversalTime();
        }