private void addSnippetButton_Click(object sender, EventArgs e) { var selectedGroupIndex = groupsList.SelectedIndex; var addForm = new AddSnippetForm(); addForm.SelectedId = groupsList.SelectedIndex; addForm.ShowDialog(); // Execute after dialog finished? ReloadGroupsUI(); UpdateTrayMenu(); groupsList.SelectedIndex = selectedGroupIndex; }
private void editSnippetButton_Click(object sender, EventArgs e) { int selectionCount = snippetsList.SelectedIndices.Count; if (selectionCount != 1) { return; } var snippet = currentSnippets[snippetsList.SelectedIndex]; var selectedGroupIndex = groupsList.SelectedIndex; var editForm = new AddSnippetForm(snippet); editForm.SelectedId = selectedGroupIndex; editForm.ShowDialog(); // Execute after dialog finished? ReloadGroupsUI(); ReloadSnippetsList(selectedGroupIndex); UpdateTrayMenu(); groupsList.SelectedIndex = selectedGroupIndex; }