void selection_FieldAdded(QVField obj) { if (FieldCollection.ContainsKey(obj.Name)) { FieldCollection.Remove(obj.Name); } FieldCollection.Add(obj.Name, obj); this.RefreshFieldDataGrid(); }
private void btnVariableAdd_Click(object sender, EventArgs e) { VariableSettingForm form = new VariableSettingForm(); DialogResult result = form.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { QvVariable variable = new QvVariable(); variable.Name = form.VariableName; variable.Value = form.Value; variable.Expression = form.Expression; if (!VariableCollection.ContainsKey(variable.Name)) { VariableCollection.Add(variable.Name, variable); } this.RefreshVariableDataGrid(); } }