ZennoLab Assemblies Documentation
AddTries(Guid,Int32) Method
Example 

Type: System.Guid

Id of task.

Type: System.Int32

Count of tries to add.

Adds tries to the task
Syntax
public static void AddTries( 
   Guid id,
   int count
)

Parameters

id

Type: System.Guid

Id of task.

count

Type: System.Int32

Count of tries to add.

Example
The following example shows call the AddTries method.
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
 
// Check the presence of items in the list
if(tasksList.Count != 0)
{
    // Select ane item
    var source = tasksList[0];
    // Sets path to task id
    var xpath = "Task/Id";
 
    // Gets guid string from task data
    var doc = new System.Xml.XmlDocument();
    doc.LoadXml("<Task>" + source + "</Task>");
    string result;
    var node = doc.SelectSingleNode(xpath);
    if (node != null)
        result = node.InnerXml;
    else 
        throw new InvalidDataException(string.Format("{0} is null", xpath));
 
    Guid id;
    // Parse guid
    if (Guid.TryParse(result, out id))
        // If ok, start the task
        ZennoPoster.AddTries(id, 30);
    else
        throw new FormatException(string.Format("{0} is not guid", result));
}
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
 
// Check the presence of items in the list
if(tasksList->Count != 0)
{
    // Select ane item
    $source = $tasksList[0];
    // Sets path to task id
    $xpath = "Task/Id";
 
    // Gets guid string from task data
    $doc = new System\Xml\XmlDocument();
    $doc->LoadXml("<Task>" + $source + "</Task>");
    $result;
    $node = $doc->SelectSingleNode($xpath);
    if ($node != null)
        $result = $node->InnerXml;
    else 
        throw new InvalidDataException(String::Format("{0} is null", $xpath));
 
    $id = "";
    // Parse guid
    if (Guid::TryParse($result, $id))
        // If ok, start the task
        ZennoPoster::AddTries($id, 30);
    else
        throw new FormatException(String::Format("{0} is not guid", $result));
}
Requirements

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

See Also

Reference

ZennoPoster Class
ZennoPoster Members
Overload List

Send Feedback