/// <summary> /// Clicking "Load" /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void loadToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.InitialDirectory = BaseFolder; openFileDialog1.FileName = string.Empty; DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { if (Data.Load(openFileDialog1.FileName)) { if (alternateContent != null) { alternateContent.Init(Data); alternateContent.RefreshValues(); PrefChanged(PrefPropertyGrid, new PropertyChangedEventArgs("All")); } else { PrefPropertyGrid.Refresh(); PrefChanged(PrefPropertyGrid, new PropertyChangedEventArgs("All")); } } else { TKMessageBox.ShowError("Can't load selected Preference !", "Preference error"); } } }
/// <summary> /// Clicking "Defaults" /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void revertToDefaultsToolStripMenuItem_Click(object sender, EventArgs e) { if (Data.Load(BaseFolder + "\\Default.xml")) { if (alternateContent != null) { alternateContent.RefreshValues(); PrefChanged(alternateContent, new PropertyChangedEventArgs("All")); } else { PrefPropertyGrid.Refresh(); PrefChanged(PrefPropertyGrid, new PropertyChangedEventArgs("All")); } } else { MessageBox.Show("Can't load Default Preference !", "Preference error"); } }