Пример #1
0
        public FieldBinding(Field field)
        {
            if (field == null)
                throw new ArgumentNullException("field");

            _field = field;
            _items = new[] {this};
            _field.Name = NotEmpty(_field.Name);
        }
Пример #2
0
            private void Set(string key, bool isProtected)
            {
                Field field;
                if (!_fields.TryGetValue(key, out field))
                {
                    field = new Field
                    {
                        Name = key,
                    };

                    _fields.Add(key, field);
                }

                field.Protected = isProtected;
            }
Пример #3
0
 public void DeleteField(Field field)
 {
     if (field == null)
         throw new ArgumentNullException("field");
     if (_known.Any(n => n == field.Name))
         throw new ArgumentException("Reserved Field");
 }
Пример #4
0
 public void Add(Field field)
 {
     if (field == null)
         throw new ArgumentNullException("field");
     if (_fields.Values.Count(p => p.Equals(field)) > 1)
         throw new ArgumentException("Duplicate Exception", string.Format("duplicate found for {0}", field.Name));
     if (!_fields.Values.Contains(field))
         _fields.AddOrSet(field.Name, field);
 }
Пример #5
0
        public Field AddField()
        {
            var field = new Field();
            _addedFields.Add(field);

            return field;
        }
Пример #6
0
        public void Add(Field field)
        {
            if (field == null)
                throw new ArgumentNullException("field");

            _fields.AddOrSet(field.Name, field);
        }