Пример #1
0
        /// <summary>
        /// Searches for the specified <see cref="ContextMenuItem"/> and returns the zero-based index of the first occurrence within the entire collection.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        public int IndexOf(ContextMenuItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            return(_contextMenuItemCollection.IndexOf(item));
        }
Пример #2
0
        /// <summary>
        /// Determines whether contains the specified item.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns>
        ///     <c>true</c> if contains the specified item; otherwise, <c>false</c>.
        /// </returns>
        public bool Contains(ContextMenuItem item)
        {
            if (item == null)
            {
                return(false);
            }

            return(_contextMenuItemCollection.Contains(item));
        }
Пример #3
0
 /// <summary>
 /// Inserts at the specified index.
 /// </summary>
 /// <param name="index">The index.</param>
 /// <param name="item">The item.</param>
 public void Insert(int index, ContextMenuItem item)
 {
     _contextMenuItemCollection[index] = item;
 }
Пример #4
0
 /// <summary>
 /// Adds the specified item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns></returns>
 public int Add(ContextMenuItem item)
 {
     return(_contextMenuItemCollection.Add(item));
 }
Пример #5
0
 /// <summary>
 /// Removes the specified item.
 /// </summary>
 /// <param name="item">The item.</param>
 public void Remove(ContextMenuItem item)
 {
     _contextMenuItemCollection.Remove(item);
 }