# DesktopTaskBarItemCollection

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Represents the collection of [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) controls in a [Desktop](https://docs.wisej.com/api/wisej.web/containers/desktop) control.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DesktopTaskBarItemCollection : IList, ICollection, IEnumerable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DesktopTaskBarItemCollection
    Inherits IList
    Implements ICollection, IEnumerable
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) DesktopTaskBarItemCollection(owner)

Initializes a new instance of the [DesktopTaskBarItemCollection](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemcollection) class.

| Name      | Type                                                               | Description                                                                                               |
| --------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| **owner** | [Desktop](https://docs.wisej.com/api/wisej.web/containers/desktop) | The [Desktop](https://docs.wisej.com/api/wisej.web/containers/desktop) control that owns this collection. |

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IsReadOnly

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether this collection is read-only.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(index)

[DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem): Returns or sets the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) at the specified index.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(name)

[DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem): Returns the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) identified by the name.

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(text)

Adds a [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) with the specified text to the collection.

| Parameter | Type                                                          | Description                                                                                                                                      |
| --------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text for the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) that is being added. |

**Returns:** [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem). A [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) that represents the item that was added to the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(item)

Adds a [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) to the collection.

| Parameter | Type                                                                                                       | Description                                                                                                                                                      |
| --------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | A [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) that represents the panel to add to the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index of the item in the collection.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  The [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) being added to the collection is null.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The parent of the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) specified in the *item* parameter is not null.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AddRange(items)

Adds an array of [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) to the collection.

| Parameter | Type                                                                                                           | Description                                                                                                                                           |
| --------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **items** | [DesktopTaskBarItem\[\]](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | Array of [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) objects to add to the collection. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Clear()

Removes all [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) objects from the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Clear(dispose)

Removes and optionally disposes all [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) objects from the collection.

| Parameter   | Type                                                            | Description                                             |
| ----------- | --------------------------------------------------------------- | ------------------------------------------------------- |
| **dispose** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | Indicates whether the removed items should be disposed. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Contains(button)

Determines whether the specified [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) is located within the collection.

| Parameter  | Type                                                                                                       | Description                                                                                                                                 |
| ---------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **button** | [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | The [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) to locate in the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) is located within the collection; otherwise, false.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ContainsKey(key)

Determines whether the collection contains a [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) with the specified key.

| Parameter | Type                                                          | Description                                     |
| --------- | ------------------------------------------------------------- | ----------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the item to find in the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true to indicate the collection contains a [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) with the specified key; otherwise, false.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) GetEnumerator()

Returns an enumerator to use to iterate through the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) objects in the collection.

**Returns:** [IEnumerator](https://docs.microsoft.com/dotnet/api/system.collections.ienumerator). An [IEnumerator](https://docs.microsoft.com/dotnet/api/system.collections.ienumerator) that represents the item collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IndexOf(button)

Returns the index within the collection of the specified [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem).

| Parameter  | Type                                                                                                       | Description                                                                                                                                 |
| ---------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **button** | [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | The [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) to locate in the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index where the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) is located within the collection; otherwise, negative one (-1).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IndexOfKey(key)

Returns the index of the first occurrence of a [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) with the specified key.

| Parameter | Type                                                          | Description                                                                                                                                           |
| --------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) to find in the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index of the first occurrence of the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) with the specified key, if found; otherwise, -1.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Insert(index, button)

Inserts the specified [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) into the collection at the specified index.

| Parameter  | Type                                                                                                       | Description                                                                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **index**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                | The zero-based index location where the panel is inserted.                                                                                     |
| **button** | [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | A [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) representing the panel to insert. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  The *button* parameter is null.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The *button* parameter's parent is not null.
* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The *index* parameter is less than zero or greater than the value of the [Count](#count) property of the [DesktopTaskBarItemCollection](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemcollection).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Remove(item)

Removes the specified [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) from the collection.

| Parameter | Type                                                                                                       | Description                                                                                                                                                          |
| --------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | The [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) representing the panel to remove from the collection. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  The [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) assigned to the *item* parameter is null.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) RemoveAt(index)

Removes the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) located at the specified index within the collection.

| Parameter | Type                                                        | Description                                 |
| --------- | ----------------------------------------------------------- | ------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The zero-based index of the item to remove. |

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The *index* parameter is less than zero or greater than or equal to the value of the [Count](#count) property of the [DesktopTaskBarItemCollection](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemcollection).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) RemoveByKey(key)

Removes the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) with the specified key from the collection.

| Parameter | Type                                                          | Description                                                                                                                                               |
| --------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) to remove from the collection. |
