Ejemplo n.º 1
0
        private void RefreshDateTimeRange(DateTime start, DateTime end)
        {
            DateTime dateTime  = (start <= MinDateTime) ? MinDateTime : Utilities.RoundDateTimeToSecond(start);
            DateTime dateTime2 = (end >= MaxDateTime) ? MaxDateTime : Utilities.RoundDateTimeToSecond(end);

            startStep = CalculateStepValueByDateTime(dateTime);
            endStep   = CalculateStepValueByDateTime(dateTime2);
            if (dateTime == dateTime2)
            {
                startStep = endStep;
            }
            PaintDateTimeRange();
        }
Ejemplo n.º 2
0
        public void RefreshTimeRange(DateTime start, DateTime end)
        {
            if (start > end)
            {
                start = end;
            }
            ObjectStateController.SwitchState("RefreshState");
            startDateTimePicker.MaxDate = DateTimePicker.MaximumDateTime;
            startDateTimePicker.MinDate = DateTimePicker.MinimumDateTime;
            endDateTimePicker.MaxDate   = DateTimePicker.MaximumDateTime;
            endDateTimePicker.MinDate   = DateTimePicker.MinimumDateTime;
            DateTime dateTime  = Utilities.RoundDateTimeToSecond(start);
            DateTime dateTime2 = Utilities.RoundDateTimeToSecond(end);

            if (dateTime >= DateTimePicker.MinimumDateTime && dateTime <= DateTimePicker.MaximumDateTime && dateTime2 >= DateTimePicker.MinimumDateTime && dateTime2 <= DateTimePicker.MaximumDateTime)
            {
                startDateTimePicker.MaxDate = dateTime2;
                startDateTimePicker.MinDate = dateTime;
                endDateTimePicker.MaxDate   = startDateTimePicker.MaxDate;
                endDateTimePicker.MinDate   = startDateTimePicker.MinDate;
            }
            ObjectStateController.SwitchState();
        }
Ejemplo n.º 3
0
        private void RefreshEndDateTime(DateTime dateTime)
        {
            DateTime dateTime2 = Utilities.RoundDateTimeToSecond(dateTime);

            endDateTimePicker.Value = ((dateTime2 >= MinDateTime && dateTime2 <= MaxDateTime) ? dateTime2 : MaxDateTime);
        }