示例#1
0
文件: Nav.cs 项目: wj60387/ESkin2
 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();
     }
 }
示例#2
0
文件: Nav.cs 项目: wj60387/ESkin2
 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();
     }
 }
示例#3
0
文件: Nav.cs 项目: wj60387/ESkin2
 public bool Contains(NavItem subItem)
 {
     return(this.IndexOf(subItem) != -1);
 }
示例#4
0
文件: Nav.cs 项目: wj60387/ESkin2
 public int IndexOf(NavItem navItem)
 {
     return(Array.IndexOf <NavItem>(m_arrNavItems, navItem));
 }