ImageCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Encapsulates the collection of ImageListEntry objects in an ImageList.
- C#
- VB.NET
public class ImageCollection : IList, ICollection, IEnumerable
Public Class ImageCollection
Inherits IList
Implements ICollection, IEnumerable
Properties
Count
Int32: Returns the number of ImageListEntry in the collection.
Item(index)
ImageListEntry: Returns the image at the index.
Item(key)
ImageListEntry: Returns the first image identified by the key.
Keys
List<String>: Returns a collection with all the image keys.
Methods
Add(key, image)
Adds the image to the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The key associated with the image . |
| image | Image | An Image to add to the list. |
Add(key, imageSource)
Adds the image source to the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The key associated with the imageSource . |
| imageSource | String | The name or URL of the image to add to the list. |
Add(image)
Adds the specified image to the collection.
| Parameter | Type | Description |
|---|---|---|
| image | Image | An Image to add to the list. |
Add(imageSource)
Adds the specified imageSource to the collection.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | The name or URl of the image to add to the list. |
Add(entry)
Adds the image entry to the collection.
| Parameter | Type | Description |
|---|---|---|
| entry | ImageListEntry | The ImageListEntry to add to the collection. |
AddRange(entries)
Adds an array of ImageListEntry to the collection.
| Parameter | Type | Description |
|---|---|---|
| entries | ImageListEntry[] | An array of ImageListEntry objects |
Throws:
- ArgumentNullException entries is null.
- ArgumentException entries is the child of another TreeView.
Clear()
Removes all images from the collection.
Contains(image)
Finds if the collection contains the image .
| Parameter | Type | Description |
|---|---|---|
| image | Image | The Image to locate in the collection. |
Returns: Boolean. True if the collection contains the specified image .
ContainsKey(key)
Finds if the collection contains the image key .
| Parameter | Type | Description |
|---|---|---|
| key | String | The key to locate in the collection. |
Returns: Boolean. True if the collection contains the specified key .
GetEnumerator()
Returns an enumerator that iterates the images in the collection.
Returns: IEnumerator.
IndexOf(image)
Returns the index of the image in the collection.
| Parameter | Type | Description |
|---|---|---|
| image | Image | The Image to located in the collection. |
Returns: Int32. The index of the specified image in the collection; otherwise -1 if not found.
IndexOfKey(key)
Returns the index of the image key in the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The key to located in the collection. |
Returns: Int32. The index of the specified key in the collection; otherwise -1 if not found.
Insert(index, entry)
Inserts the ImageListEntry at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The position in the collection where to add the entry . |
| entry | ImageListEntry | The ImageListEntry to add to the collection at the specified index . |
Remove(image)
Removes the image from the collection.
| Parameter | Type | Description |
|---|---|---|
| image | Image | The Image to remove from the collection. |
RemoveAt(index)
Removes the image at the specified index from the collection.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the ImageListEntry to remove from the collection. |
RemoveByKey(key)
Removes the images identified by the key from the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The key of the ImageListEntry to remove from the collection. |
SetKeyName(index, name)
Sets the key (name) associated with the image.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the ImageListEntry to change. |
| name | String | The new name of the ImageListEntry at the specified index . |