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