Пример #1
0
        public Hours Set(DayOfWeek Weekday,
                         HourMin Begin,
                         HourMin End)
        {
            _RegularHours[(int)Weekday] = new RegularHours(Weekday, Begin, End);

            return(this);
        }
Пример #2
0
        public void Hours_In_Range()
        {
            //arrange
            int[]   expected = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            HourMin hour     = new HourMin();

            //act
            int[] actual = hour.Hours;
            Assert.AreEqual(expected, actual);
        }
        public void Hours_In_Range()
        {
            //arrange
            int[] expected = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            HourMin hour = new HourMin();

            //act
            int[] actual = hour.Hours;
            Assert.AreEqual(expected,actual);
            
        }
Пример #4
0
        /// <summary>
        /// Create a new specification of a regular recurring operation or access regular hours.
        /// </summary>
        /// <param name="Weekday">Day of the week, from Monday till Sunday.</param>
        /// <param name="Begin">Begin of the regular period given in regular hours and minutes. Must be in 24h format.</param>
        /// <param name="End">End of the regular period, syntax as for period_begin. Must be later than the begin.</param>
        public RegularHours(DayOfWeek Weekday,
                            HourMin Begin,
                            HourMin End)
        {
            if (Begin >= End)
            {
                throw new ArgumentException("Begin time must be before the end time!");
            }

            this.Weekday = Weekday;
            this.Begin   = Begin;
            this.End     = End;
        }
Пример #5
0
        protected void DrawNonWorkHours(PaintEventArgs e, HourMin start, HourMin end, Rectangle rect, Brush brush)
        {
            if (start < end)
            {
                Rectangle hoursRect = GetHourRangeRectangle(start, end, rect);

                if (hoursRect.Y < this.HeaderHeight)
                {
                    hoursRect.Height -= this.HeaderHeight - hoursRect.Y;
                    hoursRect.Y       = this.HeaderHeight;
                }

                e.Graphics.FillRectangle(brush, hoursRect);
            }
        }
Пример #6
0
        //public override bool Equals(object obj)
        //{
        //    CellQuery snd = obj as CellQuery;
        //    return Equals2(snd);
        //}

        //public bool Equals2(CellQuery other)
        //{
        //    if (other == null)
        //        return false;
        //    if (hash != other.hash)
        //        return false;
        //    bool b = (other.latmax != latmax) ||
        //         (other.latmin != latmin) ||
        //         (other.lonmax != lonmax) ||
        //         (other.lonmin != lonmin) ||
        //         (other.DayMax != DayMax) ||
        //         (other.DayMin != DayMin) ||
        //         (other.HourMax != HourMax) ||
        //         (other.HourMin != HourMin) ||
        //         (other.YearMax != YearMax) ||
        //         (other.YearMin != YearMin) ||
        //         (other.parameter != parameter);
        //    return !b;
        //}


        public override int GetHashCode()
        {
            //TODO save hashing results
            int r = (int)parameter << 2 ^
                    base.GetHashCode() ^
                    YearMin.GetHashCode() ^
                    YearMax.GetHashCode() << 1 ^
                    DayMin.GetHashCode() ^
                    DayMax.GetHashCode() << 2 ^
                    HourMin.GetHashCode() ^
                    HourMax.GetHashCode() >> 2 ^
                    (int)landOceanCoverage << 3;

            return(r);
        }
Пример #7
0
        /// <summary>
        /// Create a new specification of a regular recurring operation or access hours.
        /// </summary>
        /// <param name="Weekday">Day of the week, from Monday till Sunday.</param>
        /// <param name="Begin">Begin of the regular period given in hours and minutes. Must be in 24h format.</param>
        /// <param name="End">End of the regular period, syntax as for period_begin. Must be later than the begin.</param>
        public RegularHours(DayOfWeek Weekday,
                            HourMin Begin,
                            HourMin End)
        {
            #region Initial checks

            if (Begin > End)
            {
                throw new ArgumentException("Begin time must be before the end time!");
            }

            #endregion

            this._Weekday = Weekday;
            this._Begin   = Begin;
            this._End     = End;
        }