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