Exemple #1
0
 public void RemoveAt(int index)
 {
     if (index < 0 || index >= this.count)
     {
         throw new IndexOutOfRangeException("Index was outside the bounds of the array");
     }
     this.count--;
     for (int i = index, Len = this.count; i < Len; i++)
     {
         m_arrNavItems[i] = m_arrNavItems[i + 1];
     }
     NavItem[] arrTempSubItem = new NavItem[count];
     Array.Copy(m_arrNavItems, arrTempSubItem, count);
     m_arrNavItems = arrTempSubItem;
     if (this.owner != null)
     {
         this.owner.Invalidate();
     }
 }
Exemple #2
0
 public void Insert(int index, NavItem navItem)
 {
     if (index < 0 || index >= this.count)
     {
         throw new IndexOutOfRangeException("Index was outside the bounds of the array");
     }
     if (navItem == null)
     {
         throw new ArgumentNullException("SubItem cannot be null");
     }
     this.EnsureSpace(1);
     for (int i = this.count; i > index; i--)
     {
         m_arrNavItems[i] = m_arrNavItems[i - 1];
     }
     navItem.OwnerNav     = this.owner;
     m_arrNavItems[index] = navItem;
     this.count++;
     if (this.owner != null)
     {
         this.owner.Invalidate();
     }
 }
Exemple #3
0
 public bool Contains(NavItem subItem)
 {
     return(this.IndexOf(subItem) != -1);
 }
Exemple #4
0
 public int IndexOf(NavItem navItem)
 {
     return(Array.IndexOf <NavItem>(m_arrNavItems, navItem));
 }