Example #1
0
 private void LoadDictionary(Field[] list)
 {
     fields.Clear();
     foreach (var f in list)
     {
         this.Set(f, false);
     }
     this.all = fields.Values.ToArray();
 }
Example #2
0
 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;
         }
     }
 }
Example #3
0
 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);
     }
 }
Example #4
0
 public void Add(Field value)
 {
     Set(value, true);
 }
Example #5
0
 public void AddValues(Field field)
 {
     this.Values.AddRange(field.Values);
 }