public void AddRange(ToolStripItemCodonCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
 public static void Update(System.Windows.Forms.ToolStrip toolStrip, ToolStripItemCodonCollection codonCollection)
 {
     if (codonCollection == null || toolStrip == null)
     {
         Debug.Assert(false, "ToolStrip 或 CodonCollection为null");
         return;
     }
     toolStrip.Items.Clear();
     foreach (IToolStripItemCodon codon in codonCollection)
     {
         toolStrip.Items.Add((ToolStripItem)codon.View);
     }
 }
        public void RegisterItem(string path, IToolStripItemCodon item)
        {
            if (String.IsNullOrEmpty(path) || item == null)
            {
                Debug.Assert(false, "RegisterToolStripItem,没有指定path或toolStripItem");
                return;
            }
            ToolStripPath toolStripPath = new ToolStripPath(path);

            if (toolStripPath.IsEmpty)
            {
                Debug.Assert(false, "RegisterToolStripItem,toolStripPath.IsEmpty");
                return;
            }
            IToolStripDropDownItemCodon  targetItem           = null;
            ToolStripItemCodonCollection targetItemCollection = this;

            for (int i = 0; i < toolStripPath.PathPoints.Count; i++)
            {
                foreach (IToolStripItemCodon targetItemCodon in targetItemCollection)
                {
                    if (targetItemCodon.PathPoint == toolStripPath.PathPoints[i].Name &&
                        targetItemCodon is IToolStripDropDownItemCodon)
                    {
                        targetItem           = targetItemCodon as IToolStripDropDownItemCodon;
                        targetItemCollection = targetItem.Items;
                        break;
                    }
                }
            }
            if (targetItem != null)
            {
                if (toolStripPath.PathPoints[toolStripPath.PathPoints.Count - 1].Index.HasValue)
                {
                    int index = toolStripPath.PathPoints[toolStripPath.PathPoints.Count - 1].Index.Value;
                    if (index >= targetItem.Items.Count)
                    {
                        index = targetItem.Items.Count;
                    }
                    targetItem.Items.Insert(index, item);
                }
                else
                {
                    targetItem.Items.Add(item);
                }
            }
        }
 public ToolStripItemCodonCollection(ToolStripItemCodonCollection value)
 {
     this.AddRange(value);
 }
 public ToolStripItemAbstractEnumerator(ToolStripItemCodonCollection mappings)
 {
     this.temp           = ((IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }