Пример #1
0
        internal bool GetStateOfInterval(DayOfWeek day, int intervalOfDay)
        {
            int  bitPosition = ScheduleBuilder.GetBitPosition(day, intervalOfDay);
            int  num         = bitPosition / 8;
            byte b           = (byte)(128 >> bitPosition % 8);

            return(0 != (this.schedule[num] & b));
        }
Пример #2
0
        internal void SetStateOfInterval(DayOfWeek day, int intervalOfDay, bool state)
        {
            int  bitPosition = ScheduleBuilder.GetBitPosition(day, intervalOfDay);
            int  num         = bitPosition / 8;
            byte b           = (byte)(128 >> bitPosition % 8);

            if (state)
            {
                byte[] array = this.schedule;
                int    num2  = num;
                array[num2] |= b;
                return;
            }
            byte[] array2 = this.schedule;
            int    num3   = num;

            array2[num3] &= ~b;
        }