private void ButtonModifyColorizerClick(object sender, EventArgs e) { var colorizer = GetSelectedColorizer(); if (colorizer == null) { return; } var edit = new ColorizerEdit(colorizer); var dr = edit.ShowDialog(this); listViewColorizers.Focus(); if (dr != DialogResult.OK) { return; } var existing = GetExistingColorizer(edit.Colorizer); if ((existing != null) && (existing != edit.Colorizer)) { Remove(edit.Colorizer); return; } var item = listViewColorizers.SelectedItems[0]; item.Text = edit.Colorizer.Active.ToString(); item.SubItems[1].Text = edit.Colorizer.IgnoreCase.ToString(); item.SubItems[2].Text = edit.Colorizer.Definition; }
private void ButtonAddColorizerClick(object sender, EventArgs e) { ColorizerEdit edit = new ColorizerEdit(null); DialogResult dr = edit.ShowDialog(this); listViewColorizers.Focus(); if (dr != DialogResult.OK) return; Colorizer existing = GetExistingColorizer(edit.Colorizer); if (existing != null) { GetColorizerItem(existing).Selected = true; return; } listViewColorizers.Items.Add(GetColorizerItem(edit.Colorizer)).Selected = true; }
private void ButtonAddColorizerClick(object sender, EventArgs e) { var edit = new ColorizerEdit(null); var dr = edit.ShowDialog(this); listViewColorizers.Focus(); if (dr != DialogResult.OK) { return; } var existing = GetExistingColorizer(edit.Colorizer); if (existing != null) { GetColorizerItem(existing).Selected = true; return; } listViewColorizers.Items.Add(GetColorizerItem(edit.Colorizer)).Selected = true; }
private void ButtonModifyColorizerClick(object sender, EventArgs e) { Colorizer colorizer = GetSelectedColorizer(); if (colorizer == null) return; ColorizerEdit edit = new ColorizerEdit(colorizer); DialogResult dr = edit.ShowDialog(this); listViewColorizers.Focus(); if (dr != DialogResult.OK) return; Colorizer existing = GetExistingColorizer(edit.Colorizer); if ((existing != null) && (existing != edit.Colorizer)) { Remove(edit.Colorizer); return; } ListViewItem item = listViewColorizers.SelectedItems[0]; item.Text = edit.Colorizer.Active.ToString(); item.SubItems[1].Text = edit.Colorizer.IgnoreCase.ToString(); item.SubItems[2].Text = edit.Colorizer.Definition; }