private void openToolStripButton_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { options.LoadReplacements(openFileDialog1.FileName); bindingSource1.DataSource = options.replacements; } catch (Exception) { MessageBox.Show("Failed to load replacements!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void addButton_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { Options tmp = new Options(); tmp.LoadReplacements(openFileDialog1.FileName); options.replacements.AddRange(tmp.replacements); bindingSource1.ResetBindings(false); } catch (Exception) { MessageBox.Show("Failed to add replacements!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void addButton_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { Options tmp = new Options(); tmp.LoadReplacements(openFileDialog1.FileName); options.replacements.AddRange(tmp.replacements); bindingSource1.ResetBindings(false); } catch (Exception) { MessageBox.Show("Failed to add replacements!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }