public void Add(DeluxeMenuStripItem item)
 {
     this.listItems.Add(item);
     if (this.marked)
     {
         item.Dirty = true;
     }
 }
 public void Add(DeluxeMenuStripItem item)
 {
     this.listItems.Add(item);
     if (this.marked)
     {
         item.Dirty = true;
     }
 }
 public void Insert(int index, DeluxeMenuStripItem item)
 {
     this.listItems.Insert(index, item);
     if (this.marked)
     {
         this.saveAll = true;
     }
 }
        public void Remove(DeluxeMenuStripItem item)
        {
            int index = this.IndexOf(item);

            if (index >= 0)
            {
                this.RemoveAt(index);
            }
        }
Ejemplo n.º 5
0
        public override bool Equals(object o)
        {
            DeluxeMenuStripItem item = o as DeluxeMenuStripItem;

            if (item == null)
            {
                return(false);
            }
            return(this.Value.Equals(item.Value) && this.Text.Equals(item.Text));
        }
 public void AddRange(DeluxeMenuStripItem[] items)
 {
     if (items == null)
     {
         throw new ArgumentNullException("items");
     }
     foreach (DeluxeMenuStripItem item in items)
     {
         this.Add(item);
     }
 }
        int IList.Add(object item)
        {
            DeluxeMenuStripItem item2 = (DeluxeMenuStripItem)item;
            int num = this.listItems.Add(item2);

            if (this.marked)
            {
                item2.Dirty = true;
            }
            return(num);
        }
 internal void LoadViewState(object state)
 {
     if (state != null)
     {
         if (state is Pair)
         {
             Pair      pair   = (Pair)state;
             ArrayList first  = (ArrayList)pair.First;
             ArrayList second = (ArrayList)pair.Second;
             for (int i = 0; i < first.Count; i++)
             {
                 int num2 = (int)first[i];
                 if (num2 < this.Count)
                 {
                     this[num2].LoadViewState(second[i]);
                 }
                 else
                 {
                     DeluxeMenuStripItem item = new DeluxeMenuStripItem();
                     item.LoadViewState(second[i]);
                     this.Add(item);
                 }
             }
         }
         else
         {
             Triplet triplet = (Triplet)state;
             this.listItems = new ArrayList();
             this.saveAll   = true;
             string[] strArray  = (string[])triplet.First;
             string[] strArray2 = (string[])triplet.Second;
             bool[]   third     = (bool[])triplet.Third;
             for (int j = 0; j < strArray.Length; j++)
             {
                 this.Add(new DeluxeMenuStripItem(strArray[j], strArray2[j], third[j]));
             }
         }
     }
 }
 public bool Contains(DeluxeMenuStripItem item)
 {
     return this.listItems.Contains(item);
 }
 public void Remove(DeluxeMenuStripItem item)
 {
     int index = this.IndexOf(item);
     if (index >= 0)
     {
         this.RemoveAt(index);
     }
 }
 internal void LoadViewState(object state)
 {
     if (state != null)
     {
         if (state is Pair)
         {
             Pair pair = (Pair)state;
             ArrayList first = (ArrayList)pair.First;
             ArrayList second = (ArrayList)pair.Second;
             for (int i = 0; i < first.Count; i++)
             {
                 int num2 = (int)first[i];
                 if (num2 < this.Count)
                 {
                     this[num2].LoadViewState(second[i]);
                 }
                 else
                 {
                     DeluxeMenuStripItem item = new DeluxeMenuStripItem();
                     item.LoadViewState(second[i]);
                     this.Add(item);
                 }
             }
         }
         else
         {
             Triplet triplet = (Triplet)state;
             this.listItems = new ArrayList();
             this.saveAll = true;
             string[] strArray = (string[])triplet.First;
             string[] strArray2 = (string[])triplet.Second;
             bool[] third = (bool[])triplet.Third;
             for (int j = 0; j < strArray.Length; j++)
             {
                 this.Add(new DeluxeMenuStripItem(strArray[j], strArray2[j], third[j]));
             }
         }
     }
 }
 public void Insert(int index, DeluxeMenuStripItem item)
 {
     this.listItems.Insert(index, item);
     if (this.marked)
     {
         this.saveAll = true;
     }
 }
 public int IndexOf(DeluxeMenuStripItem item)
 {
     return this.listItems.IndexOf(item);
 }
 public bool Contains(DeluxeMenuStripItem item)
 {
     return(this.listItems.Contains(item));
 }
 public int IndexOf(DeluxeMenuStripItem item)
 {
     return(this.listItems.IndexOf(item));
 }