public UserVariableListControl() { this.InitializeComponent(); this.collection = new UserVariableCollection(); this.uniqueVariables = new List<string>(); }
public UserVariableListControl() { this.InitializeComponent(); this.collection = new UserVariableCollection(); this.uniqueVariables = new List <string>(); }
private void btnIncludeDelete_Click(object sender, EventArgs e) { if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0) { var lvi = this.listView2.SelectedItems[0]; if (lvi != null) { var rule = lvi.Tag as UserVariable; var inheritedRule = lvi.Tag as InheritedVariableContainer; if (rule != null) { var dialogResult = MessageBox.Show( this, "Are you sure you want to delete this rule?", "Delete rule", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); if (dialogResult == DialogResult.Yes) { this.collection.Remove(rule.Name); this.listView2.Items.Remove(lvi); } } else if (inheritedRule != null) { var message = "The variable you have selected is inherited from a parent or the " + "global profile and cannot be deleted from this profile."; MessageBox.Show( this, message, this.btnIncludeDelete.Text); return; } else { this.listView2.Items.Remove(lvi); } this.Items = this.Items; } } }
private void AddVariables(Dictionary<string, UserVariable> variables, UserVariableCollection collection) { this.AddVariables(variables, collection.Values); }
private void Add(UserVariable rule) { this.collection.Add(rule); this.Items = this.Items; }
private void AddUserVariables(Dictionary<string, string> collection, UserVariableCollection variables) { this.AddUserVariables(collection, variables.Values); }