Class HTMLAttributesCollection
Collection of attributes in the tag elements.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.HTMLUI
Assembly: Syncfusion.HTMLUI.Windows.dll
Syntax
public class HTMLAttributesCollection : EventBaseCollection, IHTMLAttributesCollection, IList, IHTMLCollection, ICollection, IEnumerable
Constructors
HTMLAttributesCollection(IHTMLElement)
Initializes a new instance of the HTMLAttributesCollection class
Declaration
public HTMLAttributesCollection(IHTMLElement parent)
Parameters
Type | Name | Description |
---|---|---|
IHTMLElement | parent | Parent element. |
Properties
Item[Int32]
Gets or sets the attribute with the specified index.
Declaration
public IHTMLAttribute this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | an int value |
Property Value
Type |
---|
IHTMLAttribute |
Item[String]
Gets or sets the attribute with the specified name. Name is case insensitive.
Declaration
public IHTMLAttribute this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name | String value |
Property Value
Type |
---|
IHTMLAttribute |
Parent
Gets the parent element of the current collection.
Declaration
public IHTMLElement Parent { get; }
Property Value
Type |
---|
IHTMLElement |
Methods
Add(IHTMLAttribute)
Adds specified attribute into the collection.
Declaration
public int Add(IHTMLAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
IHTMLAttribute | attr | Attribute for adding into collection. |
Returns
Type | Description |
---|---|
System.Int32 | Index in the collection. |
Add(String)
Creates an attribute with specified name and returns the reference to it.
Declaration
public IHTMLAttribute Add(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the attribute. Case insensitive. |
Returns
Type | Description |
---|---|
IHTMLAttribute | Reference of created attribute. |
Add(String, String)
Creates attribute in the collection and returns the reference to it.
Declaration
public IHTMLAttribute Add(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the attribute. Case insensitive. |
System.String | value | Value of the attribute. |
Returns
Type | Description |
---|---|
IHTMLAttribute | Reference of created attribute. |
AddRange(IHTMLAttribute[])
Adds the range of attributes into the collection.
Declaration
public void AddRange(IHTMLAttribute[] attributes)
Parameters
Type | Name | Description |
---|---|---|
IHTMLAttribute[] | attributes | Array of attributes. |
Contains(IHTMLAttribute)
Overloaded. Indicates whether the collection contains the specified attribute.
Declaration
public bool Contains(IHTMLAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
IHTMLAttribute | attr | Attribute reference for check. |
Returns
Type | Description |
---|---|
System.Boolean | True if collection contains such an attribute; false otherwise. |
Contains(String)
Indicates whether collection contains the attribute with the specified name.
Declaration
public bool Contains(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Case insensitive name of the attribute. |
Returns
Type | Description |
---|---|
System.Boolean | True if collection contains such an attribute; false otherwise. |
Finalize()
Finalizes an instance of the HTMLAttributesCollection class
Declaration
protected void Finalize()
IndexOf(IHTMLAttribute)
Returns the index of the specified attribute; if collection does not contain such attribute it will return -1.
Declaration
public int IndexOf(IHTMLAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
IHTMLAttribute | attr | Attribute whose index is needed. |
Returns
Type | Description |
---|---|
System.Int32 | Zero-based index of the attribute; -1 otherwise. |
IndexOf(String)
Returns the index of the attribute with the specified name.
Declaration
public int IndexOf(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Case insensitive name of the attribute. |
Returns
Type | Description |
---|---|
System.Int32 | Zero-based index of the attribute; -1 otherwise. |
Remove(IHTMLAttribute)
Overloaded. Removes the specified attribute from the collection, if it is belong to it.
Declaration
public void Remove(IHTMLAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
IHTMLAttribute | attr | Reference of the attribute that must be removed from the collection. |
Remove(String)
Removes the attribute with the specified name.
Declaration
public void Remove(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Case insensitive name of the attribute which must be removed. |
Events
Changed
Event raised on any attribute value change in the collection.
Declaration
public event BeforeValueChangeEventHandler Changed
Event Type
Type |
---|
BeforeValueChangeEventHandler |