private void tsmiImportReplace_Click(object sender, EventArgs e) { OPMOpenFileDialog dlg = new OPMOpenFileDialog(); dlg.InitialDirectory = Path.Combine(Environment.CurrentDirectory, "Templates\\RemoteControl"); dlg.Filter = Translator.Translate("TXT_CONFIG_FILES_FILTER"); dlg.Title = Translator.Translate("TXT_IMPORT_FULL"); if (dlg.ShowDialog() == DialogResult.OK) { _config = new RCCServiceConfig(); _config.ReadXml(dlg.FileName); _config.AcceptChanges(); DisplayRemotes(true); } }
private void ReadFromFile() { string asmPath = Assembly.GetExecutingAssembly().Location; string folder = Path.GetDirectoryName(asmPath); _cfgPath = Path.Combine(folder, "RCCService.Config"); _config = new RCCServiceConfig(); _config.ReadXml(_cfgPath); _config.AcceptChanges(); DisplayRemotes(false); BringToFront(); }