本文整理汇总了C#中TaskStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TaskStatus.ToString方法的具体用法?C# TaskStatus.ToString怎么用?C# TaskStatus.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskStatus
的用法示例。
在下文中一共展示了TaskStatus.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetXpoState
XpoState GetXpoState(TaskStatus taskStatus, XpoStateMachine stateMachine) {
var xpoState = ObjectSpace.FindObject<XpoState>(CriteriaOperator.Parse("Caption=?", taskStatus.ToString()))??ObjectSpace.CreateObject<XpoState>();
xpoState.Caption = taskStatus.ToString();
xpoState.StateMachine=stateMachine;
xpoState.MarkerValue = taskStatus.ToString();
return xpoState;
}
示例2: CreateTransition
void CreateTransition(TaskStatus startStatus, TaskStatus endStatus) {
var caption = startStatus.ToString() + endStatus;
var transition = ObjectSpace.FindObject<XpoTransition>(CriteriaOperator.Parse("Caption=?", caption)) ?? ObjectSpace.CreateObject<XpoTransition>();
transition.Caption = caption;
transition.SourceState = ObjectSpace.FindObject<XpoState>(CriteriaOperator.Parse("Caption=?", startStatus.ToString()));
transition.TargetState =ObjectSpace.FindObject<XpoState>(CriteriaOperator.Parse("Caption=?", endStatus.ToString()));
}
示例3: Get
public IEnumerable<Task> Get(TaskStatus taskStatus)
{
var url = String.Format("tasks/{0}.xml", taskStatus.ToString().ToLower());
var response = _client.Execute<List<Task>>(new RestRequest(url, Method.GET));
var tasks = response.Data;
return tasks;
}
示例4: setTaskStatus
public void setTaskStatus(TaskStatus taskStatus)
{
if (lbTaskStatus.InvokeRequired)
lbTaskStatus.Invoke(new EventHandler((sender, e) => setTaskStatus(taskStatus)));
else
{
lbTaskStatus.Text = taskStatus.ToString();
switch (taskStatus)
{
case TaskStatus.Completed_OK:
setResultText("OK", Color.Green);
setProgressBarValue(taskProgressBar.Maximum);
break;
case TaskStatus.Completed_Failed:
setResultText("Fail", Color.Red);
break;
default:
setResultText("...", Color.Orange);
break;
}
}
}
示例5: CreateTask
// If success, use the next argument as the result;
// if !success, use all the subsequent arguments as the error_info.
public string CreateTask(TaskStatus status, params string[] result)
{
Proxy_Task task = new Proxy_Task();
task.uuid = String.Format("task{0}", rand.Next());
task.name_label = task.uuid;
task.name_description = "";
task.created = DateTime.Now;
task.status = status.ToString();
if (status != TaskStatus.pending)
{
task.finished = DateTime.Now;
task.progress = 100.0;
if (status == TaskStatus.success)
{
task.result = result[0];
}
else
{
task.error_info = result;
}
}
tasks.Add(task.uuid, task);
return task.uuid;
}