예제 #1
0
        public virtual PortItem Add(Type type, string name)
        {
            PortItem item = new PortItem {
                Type = type, Name = name
            };

            Add(item);
            return(item);
        }
예제 #2
0
        public PortItem Insert(int index, PortItem item)
        {
            if (index > -1 || index <= Count)
            {
                InnerList.Insert(index, item);
            }

            throw new ArgumentOutOfRangeException("index");
        }
예제 #3
0
 public void AddRange(PortItemCollection items)
 {
     if (items == null)
     {
         throw new ArgumentNullException("items");
     }
     PortItem[] itemArray = new PortItem[items.Count];
     items.CopyTo(itemArray, 0);
     InnerList.AddRange(itemArray);
 }
예제 #4
0
 public int IndexOf(PortItem item)
 {
     for (int index = 0; index < Count; ++index)
     {
         if (this[index] == item)
         {
             return(index);
         }
     }
     return(-1);
 }
예제 #5
0
 public virtual PortItem Add(PortItem value)
 {
     InnerList.Add(value);
     return(value);
 }
예제 #6
0
 public virtual void Remove(PortItem item)
 => InnerList.Remove(item);
예제 #7
0
 public virtual bool Contains(PortItem item) => InnerList.Contains(item);