public void UpdateInList(FormControl formControl) { if (formControl != null && Exists(formControl)) { // FormControls.Find(x => x.Id == formControl.Id).Name = formControl.Name; var trash = new FormControl(); dictionaries.FormControls.TryRemove(formControl.UniqueID(), out trash); dictionaries.AddFormControl(formControl); } }
public bool Exists(FormControl formControl) { return(dictionaries.FormControls.ContainsKey(formControl.UniqueID())); }