public MainWindow()
        {
            InitializeComponent();
            GlobalSetting.LoadSetting();
            InitializeSetting();
            ShowTime();
            TaskShedule.LoadTaskXML();

            if (System.IO.File.Exists("setting.s"))
            {
                mainSchedule.LoadFileXML(GlobalSetting.PathMainSchedule);
                InitializeMainScheduleList();
                UpdateMainSchedule();
            }
        }
        /// <summary>
        /// Проверка задач
        /// </summary>
        /// <param name="tasks">лист задач</param>
        void CheckScheduleTasks(List <Task> tasks)
        {
            for (int i = 0; i < tasks.Count; i++)
            {
                if (tasks[i].timeSwitch.Hour == DateTime.Now.Hour && tasks[i].timeSwitch.Minute == DateTime.Now.Minute)
                {
                    if (tasks[i].type == GlobalSetting.typeSheduleActive.mainSchedule)
                    {
                        rb_mainSchedule.IsChecked    = true;
                        rb_reducedSchedule.IsChecked = false;

                        isMainSchedule     = true;
                        isReducedSchedule  = false;
                        isSuterdaySchedule = false;

                        tasks.RemoveAt(i);
                        TaskShedule.SaveTaskXML();
                    }
                    else if (tasks[i].type == GlobalSetting.typeSheduleActive.reducedSchedule)
                    {
                        rb_mainSchedule.IsChecked    = false;
                        rb_reducedSchedule.IsChecked = true;

                        isMainSchedule     = false;
                        isReducedSchedule  = true;
                        isSuterdaySchedule = false;

                        tasks.RemoveAt(i);
                        TaskShedule.SaveTaskXML();
                    }
                    else if (tasks[i].type == GlobalSetting.typeSheduleActive.trainingAllertCall)
                    {
                        GlobalSetting.PlaySoundTrainingAllertCall();

                        tasks.RemoveAt(i);
                        TaskShedule.SaveTaskXML();
                    }
                }
            }
        }
        private void ShowTaskSchedule_click(object sender, RoutedEventArgs e)
        {
            TaskShedule taskShedule = new TaskShedule();

            taskShedule.ShowDialog();
        }