⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basemenuitemcollection.cs

📁 ComponentArt Web.UI 2006.1252 for asp.net2.0
💻 CS
字号:
using System;
using System.ComponentModel;
using System.Collections;


namespace ComponentArt.Web.UI
{
  /// <summary>
  /// Collection of BaseMenuItem objects. 
  /// </summary>
  [ToolboxItem(false)]
  public abstract class BaseMenuItemCollection : NavigationNodeCollection, IList
  {
    public BaseMenuItemCollection(BaseMenu oControl, BaseMenuItem oParent) : base(oControl, oParent)
    {
    }

    internal new BaseMenuItem this[int index] 
    {
      get 
      {
        return (BaseMenuItem)base[index];
      }
    }

    object IList.this[int index] 
    {
      get 
      {
        return (BaseMenuItem)base[index];
      }
      set
      {
        nodeList[index] = (BaseMenuItem)value;
      }
    }

    /// <summary>
    /// Add method.
    /// </summary>
    /// <param name="item">The BaseMenuItem to be added</param>
    /// <returns>Index of added node in the collection</returns>
    internal int Add(BaseMenuItem item) 
    {
      int iRetValue = base.Add(item);

      if(item.ParentItem != null && item.ParentBaseMenu != null)
      {
        if(item.ParentItem.m_bLooksApplied)
        {
          item.ApplyLooks();
        }
      }

      return iRetValue;
    }
    
    /// <summary>
    /// Contains method.
    /// </summary>
    /// <param name="item">A BaseMenuItem</param>
    /// <returns>Whether this collection contains the given item</returns>
    internal bool Contains(BaseMenuItem item) 
    {
      return base.Contains(item);
    }

    /// <summary>
    /// IndexOf method.
    /// </summary>
    /// <param name="item">A BaseMenuItem</param>
    /// <returns>Index of the given node in this collection, or a negative value.</returns>
    internal int IndexOf(BaseMenuItem item) 
    {
      return base.IndexOf(item);
    }

    /// <summary>
    /// Insert method.
    /// </summary>
    /// <param name="index">The index at which to insert the given BaseMenuItem.</param>
    /// <param name="item">A BaseMenuItem to be inserted into this collection.</param>
    internal void Insert(int index, BaseMenuItem item) 
    {
      base.Insert(index, item);
      
      if(item.ParentItem != null && item.ParentBaseMenu != null)
      {
        if(item.ParentItem.m_bLooksApplied)
        {
          item.ApplyLooks();
        }
      }
    }
    
    /// <summary>
    /// Remove method.
    /// </summary>
    /// <param name="item">The BaseMenuItem to be removed from this collection.</param>
    internal void Remove(BaseMenuItem item) 
    {
      base.Remove(item);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -