Beispiel #1
0
 public void RemoveField(FieldProperties field)
 {
     if (field == null || !Fields.Contains(field))
     {
         return;
     }
     Fields.Remove(field);
 }
Beispiel #2
0
        void CreateOrEditField <T>(IDictionary <string, T> dictionary, System.Action <FieldProperties, T> setter)
        {
            if (dictionary == null)
            {
                return;
            }

            foreach (var item in dictionary)
            {
                var localItem = item;
                var field     = Fields.FirstOrDefault(f => f.Name == localItem.Key);
                if (field == null)
                {
                    field = new FieldProperties {
                        Name = localItem.Key
                    };
                    Fields.Add(field);
                }
                setter(field, localItem.Value);
            }
        }