ZennoLab Assemblies Documentation
AddTask Method
See Also  Example Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > ZennoPoster Class : AddTask Method
task

Type: System.String

The new task to add in xml format.

Glossary Item Box

Add a new task.

Syntax

C# 
public static void AddTask( 
   string task
)

Parameters

task

Type: System.String

The new task to add in xml format.

Example

The following example shows call the AddTask method.
C#Copy Code
// Create a task in xml format
var task =
@"<Id>{guid}</Id>
<Name>{name}</Name>
<CreateTime>{date DD.MM.YYYY hh:mm:ss}</CreateTime>
<ExecutionSettings>    
    <LimitOfThreads>1</LimitOfThreads>
    <MaxAllowOfThreads>0</MaxAllowOfThreads>
    <DoneSuccesfully>0</DoneSuccesfully>
    <DoneAll>0</DoneAll>
    <NumberOfTries>0</NumberOfTries>
    <LastNumberOfTries>0</LastNumberOfTries>
    <Priority>50</Priority>
    <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
    <Status>Newbie</Status>
    <ProxyLabels></ProxyLabels>
    <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
    <GroupLabels>Без метки</GroupLabels>
    <GroupStates>Выполнены</GroupStates>
    <MaxNumOfSuccesStop>-1</MaxNumOfSuccesStop>
    <MaxNumOfFailStop>-1</MaxNumOfFailStop>
    <NumOfFailStop>0</NumOfFailStop>
</ExecutionSettings>
<SchedulerSettings>
    <StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
    <EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>
    <RepetitionCount>1</RepetitionCount>
    <ScheduleType>{EveryMinutes, EveryDays, EveryWorkDays}</ScheduleType>
    <RepeatType>{WithoutEnd, FinishAfter, FinishByDate}</RepeatType>
    <ActivateTime>{date DD.MM.YYYY hh:mm:ss}</ActivateTime>
    <ActivateWorkTime>{date DD.MM.YYYY hh:mm:ss}</ActivateWorkTime>
    <IsActive>{True, False}</IsActive>
    <NumberOfTries>0</NumberOfTries>
    <Minutes>1</Minutes>
    <Days>1</Days>
    <LastScheduleDate>{date DD.MM.YYYY hh:mm:ss}</LastScheduleDate>
    <IsClearSucces>{True, False}</IsClearSucces>
</SchedulerSettings>
<Project>
    <ProjectFileLocation>{path}</ProjectFileLocation>
    <ProjectType>Assembly</ProjectType>
</Project>";
// Add the task
ZennoPoster.AddTask(task);
PHPCopy Code
// Create a task in xml format
$task =
@"<Id>{guid}</Id>
<Name>{name}</Name>
<CreateTime>{date DD.MM.YYYY hh:mm:ss}</CreateTime>
<ExecutionSettings>    
    <LimitOfThreads>1</LimitOfThreads>
    <MaxAllowOfThreads>0</MaxAllowOfThreads>
    <DoneSuccesfully>0</DoneSuccesfully>
    <DoneAll>0</DoneAll>
    <NumberOfTries>0</NumberOfTries>
    <LastNumberOfTries>0</LastNumberOfTries>
    <Priority>50</Priority>
    <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
    <Status>Newbie</Status>
    <ProxyLabels></ProxyLabels>
    <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
    <GroupLabels>Без метки</GroupLabels>
    <GroupStates>Выполнены</GroupStates>
    <MaxNumOfSuccesStop>-1</MaxNumOfSuccesStop>
    <MaxNumOfFailStop>-1</MaxNumOfFailStop>
    <NumOfFailStop>0</NumOfFailStop>
</ExecutionSettings>
<SchedulerSettings>
    <StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
    <EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>
    <RepetitionCount>1</RepetitionCount>
    <ScheduleType>{EveryMinutes, EveryDays, EveryWorkDays}</ScheduleType>
    <RepeatType>{WithoutEnd, FinishAfter, FinishByDate}</RepeatType>
    <ActivateTime>{date DD.MM.YYYY hh:mm:ss}</ActivateTime>
    <ActivateWorkTime>{date DD.MM.YYYY hh:mm:ss}</ActivateWorkTime>
    <IsActive>{True, False}</IsActive>
    <NumberOfTries>0</NumberOfTries>
    <Minutes>1</Minutes>
    <Days>1</Days>
    <LastScheduleDate>{date DD.MM.YYYY hh:mm:ss}</LastScheduleDate>
    <IsClearSucces>{True, False}</IsClearSucces>
</SchedulerSettings>
<Project>
    <ProjectFileLocation>{path}</ProjectFileLocation>
    <ProjectType>Assembly</ProjectType>
</Project>";
// Add the task
ZennoPoster::AddTask($task);

Requirements

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

See Also

© 2013 All Rights Reserved.