public TimePeriod(int hours, byte minutes, byte seconds)
        {
            TimeValidator.ValidateHours(hours);
            TimeValidator.ValidateMinutes(minutes);
            TimeValidator.ValidateSeconds(seconds);

            this.TimeInSeconds = TimeToSecondHelper.Get(hours, minutes, seconds);
        }
        public TimePeriod(string timeString)
        {
            int  hours   = TimeFactory.GetHours(timeString);
            byte minutes = TimeFactory.GetMinutes(timeString);
            byte seconds = TimeFactory.GetSeconds(timeString);

            TimeValidator.ValidateHours(hours);
            TimeValidator.ValidateMinutes(minutes);
            TimeValidator.ValidateSeconds(seconds);

            this.TimeInSeconds = TimeToSecondHelper.Get(hours, minutes, seconds);
        }
Ejemplo n.º 3
0
        public Time(string timeString)
        {
            this.Hours   = (byte)TimeFactory.GetHours(timeString);
            this.Minutes = TimeFactory.GetMinutes(timeString);
            this.Seconds = TimeFactory.GetSeconds(timeString);

            TimeValidator.ValidateHours(this.Hours);
            TimeValidator.ValidateMinutes(this.Minutes);
            TimeValidator.ValidateSeconds(this.Seconds);

            this.TimeInSeconds = TimeToSecondHelper.Get(this.Hours, this.Minutes, this.Seconds);
        }
Ejemplo n.º 4
0
        public Time(byte hours, byte minutes, byte seconds)
        {
            this.Hours   = hours;
            this.Minutes = minutes;
            this.Seconds = seconds;

            TimeValidator.ValidateHours(this.Hours);
            TimeValidator.ValidateMinutes(this.Minutes);
            TimeValidator.ValidateSeconds(this.Seconds);

            this.TimeInSeconds = TimeToSecondHelper.Get(this.Hours, this.Minutes, this.Seconds);
        }