Class ImageCollection
Collection of images for ImageListAdv.
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class ImageCollection : CollectionBase, ICollection, IEnumerable, IList
Constructors
ImageCollection()
Initializes a new instance of the ImageCollection class.
Declaration
public ImageCollection()
Properties
Empty
Gets value indicating whether collection is empty.
Declaration
public bool Empty { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsReadOnly
Added for compatibility reasons.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type |
|---|
| System.Boolean |
Item[Int32]
Gets or sets image at specified index.
Declaration
public Image this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of image. |
Property Value
| Type | Description |
|---|---|
| System.Drawing.Image | Image at specified index |
Item[String]
Gets or sets image with specified key.
Declaration
public Image this[string key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key of image. |
Property Value
| Type | Description |
|---|---|
| System.Drawing.Image | Image with specified key. |
Keys
Gets collection of keys.
Declaration
public StringCollection Keys { get; }
Property Value
| Type |
|---|
| System.Collections.Specialized.StringCollection |
Methods
Add(Icon)
Adds icon to the collection.
Declaration
public void Add(Icon value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Icon | value | Icon to add. |
Add(Image)
Adds image to the collection.
Declaration
public void Add(Image value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Image | value | Image to add. |
Add(String, Icon)
Adds icon with specified key to collection.
Declaration
public void Add(string key, Icon icon)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key of the icon. |
| System.Drawing.Icon | icon | Icon to add. |
Add(String, Image)
Adds image with specified key to collection.
Declaration
public void Add(string key, Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key of the image. |
| System.Drawing.Image | image | Image to add. |
AddRange(Image[])
Adds array of images to collection.
Declaration
public void AddRange(Image[] images)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Image[] | images | Array of images to add. |
Contains(Image)
Checks whether collection contains given image.
Declaration
public bool Contains(Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Image | image | Image to be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if collection contains given image; otherwise false. |
ContainsKey(String)
Checks whether given key exists in collection.
Declaration
public bool ContainsKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key to be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if given key exists in collection; otherwise false. |
GetEnumerator()
Gets enumerator for collection.
Declaration
public IEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator | Enumerator for collection. |
IndexOf(Image)
Gets index of given image.
Declaration
public int IndexOf(Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Image | image | Image to get index of. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Index of given image or -1 if image doesn't exist in collection. |
IndexOfKey(String)
Gets index of given key.
Declaration
public int IndexOfKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key to get index of. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Index if given key or -1 if key doesn't exist in collection. |
Remove(Image)
Removes given image from collection.
Declaration
public void Remove(Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Image | image | Image to remove. |
RemoveByKey(String)
Removes image with specified key.
Declaration
public void RemoveByKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key of image to remove. |
SetKeyName(Int32, String)
Sets new name to specified key.
Declaration
public void SetKeyName(int index, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of key to set new name to. |
| System.String | name | New name of specified key. |