private void SetDaysViewSettingsValues(XElement root)
 {
     try
     {
         var node = root.Element("DaysViewSettings");
         DaysViewSettings.SetValues(node);
     }
     catch
     {
         DaysViewSettings = new DaysViewSettings();
     }
 }
        public void Shutdown()
        {
            if (!Directory.Exists(settingsPath))
            {
                Directory.CreateDirectory(settingsPath);
            }

            var xml = new XElement("root");

            xml.Add(AppSettings.GetXML());
            xml.Add(LogsViewSettings.GetXML());
            xml.Add(ScreenshotsViewSettings.GetXML());
            xml.Add(DaysViewSettings.GetXML());
            xml.Add(MainWindowSettings.GetXML());

            xml.Save(Path.Combine(settingsPath, SETTINGS_FILE_NAME), SaveOptions.None);
        }
        public void Initialize()
        {
            LimitsSettings          = new LimitsSettings();
            AppSettings             = new AppSettings();
            LogsViewSettings        = new LogsViewSettings();
            ScreenshotsViewSettings = new ScreenshotsViewSettings();
            DaysViewSettings        = new DaysViewSettings();
            MainWindowSettings      = new MainWindowSettings();

            if (!File.Exists(Path.Combine(settingsPath, SETTINGS_FILE_NAME)))
            {
                return;
            }

            var xml  = XDocument.Load(Path.Combine(settingsPath, SETTINGS_FILE_NAME));
            var root = xml.Element("root");

            SetAppSettingsValues(root);
            SetLogsViewSettingsValues(root);
            SetScreenshotViewSettingsValues(root);
            SetDaysViewSettingsValues(root);
            SetMainWindowSettingsValues(root);
        }