Esempio n. 1
0
        bool ISet <ISPListInfo> .Add(ISPListInfo item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            if (item.ListAlias == null)
            {
                throw new ArgumentException($"{nameof(ISPListInfo.ListAlias)} property must not be null!", nameof(item));
            }
            if (item.ListUri == null)
            {
                throw new ArgumentException($"{nameof(ISPListInfo.ListUri)}  property must not be null!", nameof(item));
            }
            if (item.Type == null)
            {
                throw new ArgumentException($"{nameof(ISPListInfo.Type)}  property must not be null!", nameof(item));
            }

            var listInfo = TryGetByAlias(item.ListAlias);

            if (listInfo != null)
            {
                throw new ArgumentException($"An item with alias '{item.ListAlias}' is already contained in the set!");
            }
            listInfo = TryGetByType(item.Type);
            if (listInfo != null)
            {
                throw new ArgumentException($"An item with type '{item.Type}' is already contained in the set!");
            }

            return(listInfoSet.Add(item));
        }
Esempio n. 2
0
 void ICollection <ISPListInfo> .Add(ISPListInfo item)
 {
     listInfoSet.Add(item);
 }
Esempio n. 3
0
 public bool Remove(ISPListInfo item)
 {
     return(listInfoSet.Remove(item));
 }
Esempio n. 4
0
 public bool Contains(ISPListInfo item)
 {
     return(listInfoSet.Contains(item));
 }