Exemple #1
0
        //
        private void OKBtn_Click(object sender, EventArgs e)
        {
            Program.settings.workTime  = (int)this.workTimeInput.Value;
            Program.settings.breakTime = (int)this.breakTimeInput.Value;
            Program.settings.restTime  = (int)this.restTimeInput.Value;

            if (!Program.settings.filePath.Equals(this.filePathTextBox.Text))
            {
                if ((this.filePathTextBox.Text != null) && !this.filePathTextBox.Text.Equals(String.Empty))
                {
                    Program.settings.filePath = this.filePathTextBox.Text;
                }

                Program.settings.LoadDataFromFile(Program.settings.filePath);

                Program.settings.filePathChaged = true;
            }


            XmlProcessing.SaveConfigToFile();
        }
Exemple #2
0
 private void saveButton_Click(object sender, EventArgs e)
 {
     //ToDo: добавить обработку ошибок. Начать здесь
     XmlProcessing.SaveProjectsToFile(Program.settings.filePath);
     MessageBox.Show("Data saved to " + Program.settings.filePath);
 }
Exemple #3
0
 public void LoadDataFromFile(string filePath)
 {
     this.projects = XmlProcessing.LoadProjectsFromFile(filePath);
     this.xmlTree  = ProjectsToTree(this.projects);
 }
Exemple #4
0
 public SettingsAndConfig()
 {
     parseDictionary(XmlProcessing.LoadValuesFromConfig());
     // xmlTree = XmlProcessing.LoadProjectsFromFile(filePath);
     LoadDataFromFile(filePath);
 }