Menu.MenuItemCollection
Wisej.Web.Menu MenuItemCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Represents a collection of MenuItem objects.
Constructors
MenuItemCollection(owner)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Initializes a new instance of MenuItemCollection.
Properties
Count
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Int32: Returns the number of items in the collection.
IsReadOnly
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Boolean: Returns a value indicating whether this collection can be modified.
Item(index)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
Item(key)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
MenuItem: Retrieves the item at the specified index within the collection.
Methods
Add(caption)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
caption | The text of the new menu item. |
Returns: MenuItem.
Add(caption, onClick)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
Add(caption, items)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
Add(item)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Adds an item to the list of items.
Parameter | Type | Description |
---|---|---|
item | The new menu item. |
Returns: Int32.
Add(index, item)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
AddRange(items)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Adds a collection of items to the list.
Parameter | Type | Description |
---|---|---|
items |
Clear()
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Removes all items from the Menu.
Clear(dispose)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Removes and disposes all items from the Menu.
Parameter | Type | Description |
---|---|---|
dispose | Indicates whether the removed items should be disposed. |
Contains(value)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
ContainsKey(key)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
CopyTo(dest, index)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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. |
Find(key, searchAllChildren)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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[].
GetEnumerator()
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Returns an enumerator that can be used to iterate through the item collection.
Returns: IEnumerator. A IEnumerator that represents the item collection.
IndexOf(value)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
IndexOfKey(key)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
Remove(item)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Removes the specified item from the list.
Parameter | Type | Description |
---|---|---|
item | The item to remove. |
RemoveAt(index)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
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.
RemoveByKey(key)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F2194374196-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVxzkjZGSCpOtYHlmOePS%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia&width=300&dpr=4&quality=100&sign=70041fd7&sv=1)
Removes the item with the specified key.
Parameter | Type | Description |
---|---|---|
key | The key of the menu item to remove. |
Last updated