ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > HtmlElementCollection Class : Insert Method |
Type: Zennolab.CommandCenter.HtmlElement
The document to insert.
Type: System.Int32
The zero-based index at which html element should be inserted.
public void Insert( HtmlElement element, int index )
Type: Zennolab.CommandCenter.HtmlElement
The document to insert.
Type: System.Int32
The zero-based index at which html element should be inserted.
Exception | Description |
---|---|
ArgumentOutOfRangeException | index is less than 0 or index is greater than Count. |
// find elements by tag HtmlElementCollection heCol = tab.FindElementsByTags("input:checkbox"); // find element by name HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByName("rad"); // if collection is invalid then return -1 if ((heCol.IsVoid) || (heCol.ErrorDetected)) return -1; // insert element to collection heCol.Insert(he, 0);
// find elements by tag $heCol = $tab->FindElementsByTags("input:checkbox"); // find element by name $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByName("rad"); // if collection is invalid then return -1 if (($heCol->IsVoid) || ($heCol->ErrorDetected)) return -1; // insert element to collection $heCol->Insert($he, 0);
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.