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