private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("Do you want to cancel the arranged printing process?", "Cancel confirmation",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                         MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
     {
         commonSet.ComputeNextTime();
         if (commonSet.SaveNextTime())
         {
             this.Close();
         }
     }
 }
        private void ApplyButton_Click(object sender, RoutedEventArgs e)
        {
            // save the configuration
            commonSet.SaveConfiguration();

            // apply the autostart setting
            commonSet.ApplyAutoStartSetting(AutoStartCheckBox.IsChecked.Value);

            // save the time of next printing
            commonSet.ComputeNextTime();
            commonSet.SaveNextTime();

            MessageBox.Show("Configuration saved");

            // update scheduled time
            commonSet.LoadNextTime();
            ScheduledTimeTextBlock.Text = commonSet.loadedNextPrintingTime.ToString();
        }