public void AddConditions() { using var dialog = new AddConditionDialog(Module, null); if (dialog.ShowDialog() != DialogResult.OK) { return; } var newItem = dialog.Item; SelectedItem.Conditions.Add(newItem); }
private void BtnEditClick(object sender, EventArgs e) { var listViewItem = ((ConditionListViewItem)lvConditions.SelectedItems[0]); var dialog = new AddConditionDialog(ServiceProvider, listViewItem.Item); if (dialog.ShowDialog() != DialogResult.OK) { return; } listViewItem.Update(); InformChanges(); }
private void BtnAddClick(object sender, EventArgs e) { using (var dialog = new AddConditionDialog(ServiceProvider, null)) { if (dialog.ShowDialog() != DialogResult.OK) { return; } var newItem = dialog.Item; Rule.Conditions.Add(newItem); var listViewItem = new ConditionListViewItem(newItem); lvConditions.Items.Add(listViewItem); listViewItem.Selected = true; } InformChanges(); }