Example #1
0
        void CreateOrEditField <T>(IEnumerable <KeyValuePair <string, T> > dictionary, 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);
            }
        }
Example #2
0
 public override bool CanExecute(object parameter)
 {
     field = parameter as FieldProperties;
     return(field != null && index.Fields.Contains(field));
 }