# JavaScript.ClientEventCollection

Namespace: **Wisej.Web**

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

Represents a collection of JavaScript events and their corresponding handler code.

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

```csharp
public class ClientEventCollection : IList, ICollection, IEnumerable, IList<ClientEvent>, ICollection<ClientEvent>, IEnumerable<ClientEvent>
```

{% endtab %}

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

```visual-basic
Public Class ClientEventCollection
    Inherits IList
    Implements ICollection, IEnumerable, IList(Of ClientEvent), ICollection(Of ClientEvent), IEnumerable(Of ClientEvent)
```

{% endtab %}
{% endtabs %}

## Constructors

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

## Properties

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

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns the number of items in the collection.

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

[ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent): Returns the [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) element at the specified *index* .

## Methods

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

Adds the [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) instance to the collection.

| Parameter | Type                                                                                                      | Description                                                                                                                              |
| --------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) item to add to the collection. |

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

Removes all the [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) items from the collection.

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

Checks whether the specified *item* exists in the collection.

| Parameter | Type                                                                                                      | Description                                                                                                                                |
| --------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **item**  | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) items to find in the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). True of the collection contains the specified *item* .

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

Returns the position of the specified *item* in the collection.

| Parameter | Type                                                                                                      | Description                                                                                                                                 |
| --------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) item to locate in the collection. |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32). The index of the specified *item* or -1 if not found.

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

Inserts the *item* into the collection at the specified *index* .

| Parameter | Type                                                                                                      | Description                                                                                                                                   |
| --------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                                         | Position where to insert the *item* .                                                                                                         |
| **item**  | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) item to insert into the collection. |

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

Removes the *item* from the collection.

| Parameter | Type                                                                                                      | Description                                                                                                                                       |
| --------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) | [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) instance to remove from the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). True of the specified *item* was found and removed from the collection.

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

Removes the [ClientEvent](https://docs.wisej.com/api/v3.0/wisej.web/general/control/wisej.web.javascript.clientevent) item at the location *index* .

| Parameter | Type                                                              | Description                                         |
| --------- | ----------------------------------------------------------------- | --------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) | Position of the item to remove from the collection. |

## Events

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

[CollectionChangeEventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.collectionchangeeventhandler) Fired when the collection has changed.
