Class HTMLElementsCollection
Implementation of IHTMLElementCollection interface.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.HTMLUI
Assembly: Syncfusion.HTMLUI.Windows.dll
Syntax
public class HTMLElementsCollection : EventBaseCollection, IHTMLElementsCollection, IList, IHTMLCollection, ICollection, IEnumerable
Constructors
HTMLElementsCollection(IHTMLElement)
Initializes a new instance of the HTMLElementsCollection class
Declaration
public HTMLElementsCollection(IHTMLElement parent)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | parent | Collection parent. |
Properties
Item[Int32]
Gets or sets the HTML element specified by its collection index.
Declaration
public IHTMLElement this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | an int value |
Property Value
Type |
---|
IHTMLElement |
Item[String]
Returns the child element by its unique ID if such element exists; NULL otherwise.
Declaration
public IHTMLElement this[string uniqueID] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | uniqueID | a string id |
Property Value
Type |
---|
IHTMLElement |
Parent
Gets the parent element of the current collection.
Declaration
public IHTMLElement Parent { get; }
Property Value
Type |
---|
IHTMLElement |
Methods
Add(IHTMLElement)
Adds the specified element into the collection.
Declaration
public int Add(IHTMLElement element)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | element | Element to add into the collection. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the element added to the collection. |
Add(String)
Creates an element from it's string representation and adds it to the collection.
Declaration
public int Add(string outerHtml)
Parameters
Type | Name | Description |
---|---|---|
System.String | outerHtml | String representation of the element. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the element in the collection if created; -1 otherwise. |
AddRange(IHTMLElement[])
Adds an array of elements into the collections.
Declaration
public void AddRange(IHTMLElement[] values)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement[] | values | Array of elements. |
Clear()
Overloaded. Clears and disposes the collection of child elements.
Declaration
public void Clear()
Clear(Boolean)
Clears the collection of child elements.
Declaration
public void Clear(bool bDispose)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bDispose | Indicates whether to dispose all children. |
Contains(IHTMLElement)
Indicates whether collection contains the specified element.
Declaration
public bool Contains(IHTMLElement element)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | element | Element to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if item exists in collection; false otherwise. |
GetElementByID(String)
Search method. Returns a reference on the element with the specified ID.
Declaration
public IHTMLElement GetElementByID(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Unique id of the element. |
Returns
Type | Description |
---|---|
IHTMLElement | NULL if nothing is found; element reference otherwise. |
GetElementByUniqueID(String)
Search method. Returns a reference of the element with the specified unique ID.
Declaration
public IHTMLElement GetElementByUniqueID(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Unique id of the element. |
Returns
Type | Description |
---|---|
IHTMLElement | NULL if nothing is found; element reference otherwise. |
GetElementsByName(String)
Overloaded. Returns an array of elements with the specified name.
Declaration
public IHTMLElement[] GetElementsByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element for returning. |
Returns
Type | Description |
---|---|
IHTMLElement[] | Array of elements with such a name. |
GetElementsByName(String[])
Returns an array of elements with name from the names array.
Declaration
public IHTMLElement[] GetElementsByName(string[] names)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | names | Array of names of the element for returning. |
Returns
Type | Description |
---|---|
IHTMLElement[] | Elements with such names. |
IndexOf(IHTMLElement)
Returns the index of the element from the collection.
Declaration
public int IndexOf(IHTMLElement element)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | element | Element whose index is needed. |
Returns
Type | Description |
---|---|
System.Int32 | Zero-based index of the item in the collection. |
Insert(Int32, IHTMLElement)
Inserts the element into the specified position.
Declaration
public void Insert(int index, IHTMLElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Place where element must be placed. |
IHTMLElement | element | Element to place. |
Insert(Int32, String)
Creates an element from it's string representation and inserts it into the specified position.
Declaration
public void Insert(int index, string outerHtml)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index where element must be placed. |
System.String | outerHtml | String representation of the element. |
Remove(IHTMLElement)
Overloaded. Removes the specified element from the collection and disposes it.
Declaration
public void Remove(IHTMLElement element)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | element | Element to remove. |
Remove(IHTMLElement, Boolean)
Removes the specified element from the collection.
Declaration
public void Remove(IHTMLElement element, bool bDispose)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | element | Element to be removed from the collection. |
System.Boolean | bDispose | Indicates whether to dispose the element. |