/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnImportButtonClick(object sender, EventArgs e) { ImportSettingsDialog dlg = new ImportSettingsDialog(); if (dlg.ShowDialog() == DialogResult.OK) { if (string.IsNullOrWhiteSpace(dlg.FileName)) { return; } FileInfo fileInfo; try { fileInfo = new FileInfo(dlg.FileName); } catch (Exception ex) { MessageBox.Show(this, $@"Settings could not be imported: {ex}", @"LogExpert"); return; } ConfigManager.Import(fileInfo, dlg.ImportFlags); Preferences = ConfigManager.Settings.preferences; FillDialog(); MessageBox.Show(this, @"Settings imported", @"LogExpert"); } }
private void importButton_Click(object sender, EventArgs e) { ImportSettingsDialog dlg = new ImportSettingsDialog(); if (dlg.ShowDialog() == DialogResult.OK) { Stream fs = new FileStream(dlg.FileName, FileMode.Open, FileAccess.Read); ConfigManager.Import(fs, dlg.ImportFlags); fs.Close(); this.preferences = ConfigManager.Settings.preferences; FillDialog(); MessageBox.Show(this, "Settings imported", "LogExpert"); } }
private void importButton_Click(object sender, EventArgs e) { ImportSettingsDialog dlg = new ImportSettingsDialog(); if (dlg.ShowDialog() == DialogResult.OK) { Stream fs = new FileStream(dlg.FileName, FileMode.Open, FileAccess.Read); ConfigManager.Import(fs, dlg.ImportFlags); fs.Close(); this.Preferences = ConfigManager.Settings.preferences; FillDialog(); MessageBox.Show(this, "Settings imported", "LogExpert"); } }