Example #1
0
        public ProfileSection(string name, int lineNumber = -1) : base(lineNumber)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (name.IndexOfAny(IllegalCharacters) >= 0)
            {
                throw new ArgumentException($"The specified '{name}' section name contains illegal characters.");
            }

            _name  = name.Trim();
            _items = new ProfileItemCollection(this);
        }
        protected ProfileItemViewBase(ProfileItemCollection items)
        {
            _items           = items ?? throw new ArgumentNullException(nameof(items));
            _innerDictionary = new Dictionary <string, T>(items.Count, StringComparer.OrdinalIgnoreCase);

            foreach (var item in items)
            {
                if (this.OnItemMatch(item))
                {
                    _innerDictionary.Add(this.GetKeyForItem((T)item), (T)item);
                }
            }

            items.CollectionChanged += Items_CollectionChanged;
        }
Example #3
0
 public ProfileCommentCollection(ProfileItemCollection items)
 {
     _items = items ?? throw new ArgumentNullException(nameof(items));
 }
 public ProfileSectionCollection(ProfileItemCollection items) : base(items)
 {
 }
Example #5
0
 public ProfileEntryCollection(ProfileItemCollection items) : base(items)
 {
 }