Example #1
0
        public void ParseSchedule_should_return_valid_RouteSchedule_list_object()
        {
            var parser = new Parser();
            var text   = File.ReadAllText("xml\\schedule63.xml");
            List <RouteSchedule> schedules = parser.ParseSchedule(text);

            Assert.AreEqual(8, schedules.Count);

            RouteSchedule schedule = schedules.First();

            Assert.AreEqual("63", schedule.Tag);
            Assert.AreEqual("63-Ossington", schedule.Title);
            Assert.AreEqual("ITP2011Oct2", schedule.ScheduleClass);
            Assert.AreEqual("wkd", schedule.ServiceClass);
            Assert.AreEqual("North", schedule.Direction);

            StopSchedule first = schedule.Stops.First();

            Assert.AreEqual("14051", first.Tag);
            Assert.AreEqual(19020000, first.EpochTime);
            Assert.AreEqual("63_71_10", first.BlockId);

            StopSchedule last = schedule.Stops.Last();

            Assert.AreEqual("14197_ar", last.Tag);
            Assert.AreEqual(-1, last.EpochTime);
            Assert.AreEqual("63_99_70", last.BlockId);
        }
Example #2
0
        private void radioButtonOneTime_CheckedChanged(object sender, EventArgs e)
        {
            ModifyScheduleObject();

            if (radioButtonOneTime.Checked)
            {
                labelTakeScreenshotsOnce.Enabled = true;
                dateTimePickerCaptureAt.Enabled  = true;

                labelTakeScreenshotsPeriod.Enabled = false;
                dateTimePickerStartAt.Enabled      = false;
                labelAnd.Enabled                     = false;
                dateTimePickerStopAt.Enabled         = false;
                labelLogic.Enabled                   = false;
                comboBoxLogic.Enabled                = false;
                groupBoxInterval.Enabled             = false;
                numericUpDownHoursInterval.Enabled   = false;
                numericUpDownMinutesInterval.Enabled = false;
                numericUpDownSecondsInterval.Enabled = false;

                StopSchedule.Invoke(sender, e);

                buttonOK.Enabled            = true;
                buttonStartSchedule.Enabled = false;
                buttonStopSchedule.Enabled  = false;
            }

            CheckTimerEnabled();
        }
Example #3
0
        private void buttonStopSchedule_Click(object sender, EventArgs e)
        {
            buttonOK.Enabled            = true;
            groupBoxInterval.Enabled    = true;
            buttonStartSchedule.Enabled = true;
            buttonStopSchedule.Enabled  = false;

            if (comboBoxLogic.SelectedIndex == 0)
            {
                ScheduleObject.Timer.Tag = null;
            }
            else if (comboBoxLogic.SelectedIndex == 1)
            {
                ScheduleObject.Timer.Tag = ScheduleObject;
            }

            StopSchedule.Invoke(sender, e);
        }