private void LoadDictionary(Field[] list) { fields.Clear(); foreach (var f in list) { this.Set(f, false); } this.all = fields.Values.ToArray(); }
public void Replace(Field value) { fields.Remove(value.Name); Set(value, false); for (int i = 0; i < all.Length; i++) { if (all[i].Name == value.Name) { all[i] = value; return; } } }
private void Set(Field value, bool setArray) { if (fields.ContainsKey(value.Name)) fields[value.Name].AddValues(value); else { if (setArray) { var a = new List<Field>(all); a.Add(value); all = a.ToArray(); } fields.Add(value.Name, value); } }
public void Add(Field value) { Set(value, true); }
public void AddValues(Field field) { this.Values.AddRange(field.Values); }