NavigationBarItemCollection
Namespace: Wisej.Web.Ext.NavigationBar
Assembly: Wisej.Web.Ext.NavigationBar
Contains a collection of NavigationBarItem objects.
- C#
- VB.NET
public class NavigationBarItemCollection : IList, ICollection, IEnumerable, IList<NavigationBarItem>, ICollection<NavigationBarItem>, IEnumerable<NavigationBarItem>
Public Class NavigationBarItemCollection
Inherits IList
Implements ICollection, IEnumerable, IList(Of NavigationBarItem), ICollection(Of NavigationBarItem), IEnumerable(Of NavigationBarItem)
Properties
Count
Int32: Returns the number of items in the collection.
Item(index)
NavigationBarItem: Returns or sets a NavigationBarItem in the collection at the specified index.
Throws:
- ArgumentOutOfRangeException index is less than zero or greater than the highest available index.
- ArgumentNullException value is null.
Item(name)
NavigationBarItem: Returns the NavigationBarItem with the specified key from the collection.
Methods
Add(item)
Adds a NavigationBarItem to the collection.
| Parameter | Type | Description |
|---|---|---|
| item | NavigationBarItem | The NavigationBarItem to add. |
Throws:
- ArgumentNullException The specified item is null.
Add(text)
Creates a NavigationBarItem with the specified text, and adds it to the collection.
| Parameter | Type | Description |
|---|---|---|
| text | String | The text to display on the NavigationBarItem. |
Add(key, text)
Creates a NavigationBarItem with the specified key and text and adds it to the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the NavigationBarItem. |
| text | String | The text to display on the NavigationBarItem. |
Add(key, text, icon)
Creates a NavigationBarItem with the specified key, text, and image, and adds it to the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the NavigationBarItem. |
| text | String | The text to display on the NavigationBarItem. |
| icon | String | The Url or name of the icon to display on the NavigationBarItem. |
AddRange(items)
Adds a set NavigationBarItem objects to the collection.
| Parameter | Type | Description |
|---|---|---|
| items | NavigationBarItem[] | An array of type NavigationBarItem that contains the NavigationBarItem to add. |
Throws:
- ArgumentNullException The value of items is null.
Clear()
Removes all the NavigationBarItem instances from the collection.
Clear(dispose)
Removes and disposes all NavigationBarItem instances from the collection.
| Parameter | Type | Description |
|---|---|---|
| dispose | Boolean | Indicates whether to dispose the NavigationBarItem instances removed from the collection. |
Contains(item)
Determines whether a specified NavigationBarItem is in the collection.
| Parameter | Type | Description |
|---|---|---|
| item | NavigationBarItem | The NavigationBarItem to locate in the collection. |
Returns: Boolean. true if the specified NavigationBarItem is in the collection; otherwise, false.
Throws:
- ArgumentNullException The value of item is null.
ContainsKey(key)
Determines whether the collection contains a NavigationBarItem with the specified key.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the NavigationBarItem to search for. |
Returns: Boolean. true to indicate a NavigationBarItem with the specified key was found in the collection; otherwise, false.
CopyTo(array, index)
Copies the NavigationBarItem instances in the collection to the specified array, starting at the specified index.
| Parameter | Type | Description |
|---|---|---|
| array | NavigationBarItem[] | The one-dimensional array that is the destination of the items copied from the collection. The array must have zero-based indexing. |
| index | Int32 | The zero-based index in the array at which copying begins. |
Throws:
- ArgumentNullException array is null.
- ArgumentOutOfRangeException array is less than zero.
- ArgumentException array is multidimensional or the number of elements in the NavigationBarItemCollection is greater than the available space from index to the end of array .
IndexOf(item)
Returns the index of the NavigationBarItem in the collection.
| Parameter | Type | Description |
|---|---|---|
| item | NavigationBarItem | The NavigationBarItem to locate in the collection. |
Returns: Int32. The zero-based index of the item; -1 if it cannot be found.
Throws:
- ArgumentNullException The value of item is null.
IndexOfKey(key)
Returns the index of the first occurrence of the NavigationBarItem with the specified key.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the NavigationBarItem to find in the collection. |
Returns: Int32. The zero-based index of the first occurrence of a NavigationBarItem with the specified key, if found; otherwise, -1.
Insert(index, item)
Inserts an existing NavigationBarItem into the collection at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based index location where the NavigationBarItem is inserted. |
| item | NavigationBarItem | The NavigationBarItem to insert in the collection. |
Insert(index, text)
Creates a new NavigationBarItem with the specified text and inserts it into the collection at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based index location where the NavigationBarItem is inserted. |
| text | String | The text to display in the NavigationBarItem. |
Insert(index, key, text)
Creates a new NavigationBarItem with the specified key and text, and inserts it into the collection at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based index location where the NavigationBarItem is inserted. |
| key | String | The name of the NavigationBarItem. |
| text | String | The text to display on the NavigationBarItem. |
Insert(index, key, text, icon)
Creates a NavigationBarItem with the specified key, text, and image, and inserts it into the collection at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based index location where the NavigationBarItem is inserted. |
| key | String | The name of the item. |
| text | String | The text to display on the NavigationBarItem. |
| icon | String | The Url or name of the icon to display on the NavigationBarItem. |
Remove(item)
Removes the NavigationBarItem from the collection.
| Parameter | Type | Description |
|---|---|---|
| item | NavigationBarItem | The NavigationBarItem to remove. |
Throws:
- ArgumentNullException The item parameter is null.
RemoveAt(index)
Removes the NavigationBarItem at the specified index from the collection.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based index of the NavigationBarItem to remove. |
RemoveByKey(key)
Removes the NavigationBarItem with the specified key from the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the NavigationBarItem to remove. |