Menu.MenuItemCollection
Wisej.Web.Menu MenuItemCollection
Last updated
Wisej.Web.Menu MenuItemCollection
Last updated
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Represents a collection of MenuItem objects.
Initializes a new instance of MenuItemCollection.
Int32: Returns the number of items in the collection.
Boolean: Returns a value indicating whether this collection can be modified.
MenuItem: Retrieves the item at the specified index within the collection.
Throws:
ArgumentOutOfRangeException The index was less than zero; or the index was greater of equal to the count of items in the collection.
MenuItem: Retrieves the item at the specified index within the collection.
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
caption | The text of the new menu item. |
Returns: MenuItem.
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
caption | The text of the new menu item. | |
onClick | An event handler for the click event. |
Returns: MenuItem.
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
caption | The text of the new menu item. | |
items | List of child menu items. |
Returns: MenuItem.
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
item | The new menu item. |
Returns: Int32.
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
index | The index where to add/insert the new menu item. | |
item | The MenuItem to add to the collection |
Returns: Int32.
Adds a collection of items to the list.
Parameter | Type | Description |
---|---|---|
items |
Removes all items from the Menu.
Removes and disposes all items from the Menu.
Parameter | Type | Description |
---|---|---|
dispose | Indicates whether the removed items should be disposed. |
Determines if the specified item is located within the collection.
Parameter | Type | Description |
---|---|---|
value | An object representing the item to locate in the collection. |
Returns: Boolean. true if the item is located within the collection; otherwise, false.
Determines if the specified item is located within the collection.
Parameter | Type | Description |
---|---|---|
key | The key of the item to locate. |
Returns: Boolean. true if the item is located within the collection; otherwise, false.
Copies the entire collection into an existing array of objects at a specified location within the array.
Parameter | Type | Description |
---|---|---|
dest | The object array to copy the collection to. | |
index | The location in the destination array to copy the collection to. |
Finds all the items with a specific key.
Parameter | Type | Description |
---|---|---|
key | The key of the item to locate. | |
searchAllChildren | Indicates that the search should include child items. |
Returns: MenuItem[].
Returns an enumerator that can be used to iterate through the item collection.
Returns: IEnumerator. A IEnumerator that represents the item collection.
Retrieves the index within the collection of the specified item.
Parameter | Type | Description |
---|---|---|
value | The menu item to locate. |
Returns: Int32. The zero-based index where the item is located within the collection; otherwise, -1.
Throws:
ArgumentNullException The value parameter was null.
Retrieves the index within the collection of the specified item.
Parameter | Type | Description |
---|---|---|
key | The key for the menu item to locate. |
Returns: Int32. The zero-based index where the item is located within the collection; otherwise, -1.
Removes the specified item from the list.
Parameter | Type | Description |
---|---|---|
item | The item to remove. |
Removes an item at the specified index.
Parameter | Type | Description |
---|---|---|
index | The index of the item to remove. |
Throws:
ArgumentOutOfRangeException The index parameter was less than zero, or the index parameter was greater than or equal to the count of items in the collection.
Removes the item with the specified key.
Parameter | Type | Description |
---|---|---|
key | The key of the menu item to remove. |