Zennolab.CommandCenter
Add Method
See Also  Example Send Feedback
Zennolab.CommandCenter Namespace > HtmlElementCollection Class : Add Method
element

Type: Zennolab.CommandCenter.HtmlElement

The html element to be added to the end of the HtmlElementCollection.

Adds a html element to the end of the HtmlElementCollection.

Syntax

C# 
public void Add( 
   HtmlElement element
)

Parameters

element

Type: Zennolab.CommandCenter.HtmlElement

The html element to be added to the end of the HtmlElementCollection.

Example

The following code example demonstrates uses of the Add method. At first we take all html elements from page lessons.zennolab.com with tags "input:checkbox" then all html elements with tags "input:radio" and store in a collection HtmlElementCollection.
C#Copy Code
using System;
using Zennolab.CommandCenter;
 
namespace Sample
{
    internal class Example
    {
        public static int Execute(Instance instance)
        {
            instance.ClearCookie();
 
            Tab tab = instance.MainTab;
            if ((tab.IsVoid) || (tab.IsNull)) return -1;
            if (tab.IsBusy) tab.WaitDownloading();
            tab.Navigate("lessons.zennolab.com");
            if (tab.IsBusy) tab.WaitDownloading();
 
            HtmlElementCollection heCol = tab.FindElementsByTags("input:checkbox");
        
            HtmlElementCollection newHeCol = tab.FindElementsByTags("input:radio");
            
            for (int i = 0; i < newHeCol.Count; i++)
            {
                heCol.Add(newHeCol.Elements[i]);
            }
            
            return 0;
        }
    }
}
PHPCopy Code
<?php
import namespace System;
import namespace Zennolab:::CommandCenter;
 
class Example
{
    public static function Execute($instance)
    {
        $instance->ClearCookie();
 
        $tab = $instance->MainTab;
        if (($tab->IsVoid) || ($tab->IsNull)) return -1;
        if ($tab->IsBusy) $tab->WaitDownloading();
        $tab->Navigate("lessons.zennolab.com");
        if ($tab->IsBusy) $tab->WaitDownloading();
 
        $heCol = $tab->FindElementsByTags("input:checkbox");
            
        $newHeCol = $tab->FindElementsByTags("input:radio");
            
        for ($i = 0; $i < $newHeCol->Count; $i++)
        {
            $heCol->Add($newHeCol->Elements[$i]);
        }
        
        return 0;
    }
}
?>

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.