public UploadSchedule(UploadPeriod current) { InitializeComponent(); switch (current) { case UploadPeriod.WhenCoppied: WhenNewRadioButton.Checked = true; break; case UploadPeriod.EveryMin: EveryMinRadioButton.Checked = true; break; case UploadPeriod.EveryFive: EveryFiveMinRadioButton.Checked = true; break; case UploadPeriod.Manual: ManualRadioButton.Checked = true; break; case UploadPeriod.WhenClosed: WhenClosedRadioButton.Checked = true; break; } }
private void uploadScheduleToolStripMenuItem_Click(object sender, EventArgs e) { UploadSchedule schedule = new UploadSchedule(uploadPeriod); if (schedule.ShowDialog() == DialogResult.OK) { uploadPeriod = schedule.Period; if ((uploadPeriod == UploadPeriod.Manual) || (uploadPeriod == UploadPeriod.WhenClosed) || (uploadPeriod == UploadPeriod.WhenCoppied)) { return; } if (uploadPeriod == UploadPeriod.EveryMin) { uploadTimer.Interval = 60 * 1000; } else if (uploadPeriod == UploadPeriod.EveryFive) { uploadTimer.Interval = 60 * 1000 * 5; } uploadTimer.Start(); } }