ZennoLab Assemblies Documentation
Document Class
Members  Example  See Also  Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace : Document Class

Glossary Item Box

Represents a document on a Web page. Contains the methods to search for html elements, gets or sets of values.

Syntax

C# 
public class Document : System.MarshalByRefObject 

Remarks

This class does not contain constructors.The documents is available only from the Tab object or the Instance object. The Document class contain the properties such as ErrorDetected, IsNull and IsVoid. Their use necessary for the correct work of your code.

Example

This example uses the Document object to search for html elements and setting their values​​.
C#Copy Code
using System;
using System.Drawing;
using ZennoLab.CommandCenter;
 
namespace Sample
{
    internal class Example
    {
        public static int Execute(Instance instance)
        {
            instance.ClearCookie();
 
            Tab tab = instance.ActiveTab;
            if ((tab.IsVoid) || (tab.IsNull)) return -1;
            if (tab.IsBusy) tab.WaitDownloading();
            tab.Navigate("lessons.zennolab.com", "");
            if (tab.IsBusy) tab.WaitDownloading();
 
            Document doc = tab.MainDocument;
            
            HtmlElement he = doc.FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
            
            if (he.IsVoid) return -1;
            
            he.SetValue("true", true);
            
            he = doc.FindElementByName("rad");
            
            if (he.IsVoid) return -1;
 
            he.SetValue("0", true);
 
            return 0;
        }
    }
}
PHPCopy Code
<?php
namespace System;
namespace ZennoLab\CommandCenter;
 
class Step1
{
    public static function Execute($instance)
    {
        $instance->ClearCookie();
 
        $tab = $instance->ActiveTab;
        if (($tab->IsVoid) || ($tab->IsNull)) return -1;
        if ($tab->IsBusy) $tab->WaitDownloading();
        $tab->Navigate("lessons.zennolab.com", "");
        if ($tab->IsBusy) $tab->WaitDownloading();
        
        $doc = $tab->MainDocument;
            
        $he = $doc->FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
            
        if ($he->IsVoid) return -1;
            
        $he->SetValue("true", true);
            
        $he = $doc->FindElementByName("rad");
            
        if ($he->IsVoid) return -1;
 
        $he->SetValue("0", true);
        
        return 0;
    }
}
?>

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      ZennoLab.CommandCenter.Document

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.