本文整理汇总了C#中TaskStatus类的典型用法代码示例。如果您正苦于以下问题:C# TaskStatus类的具体用法?C# TaskStatus怎么用?C# TaskStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskStatus类属于命名空间,在下文中一共展示了TaskStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: GetByProject
public List<Task> GetByProject(int projectId, TaskStatus? status, Guid participant)
{
var query = CreateQuery()
.LeftOuterJoin("projects_milestones m", Exp.EqColumns("m.id", "t.milestone_id") & Exp.EqColumns("m.tenant_id", "t.tenant_id"))
.Where("t.project_id", projectId)
.OrderBy("t.sort_order", false)
.OrderBy("m.status", true)
.OrderBy("m.deadLine", true)
.OrderBy("m.id", true)
.OrderBy("t.status", true)
.OrderBy("t.priority", true)
.OrderBy("t.create_on", true);
if (status != null)
{
if (status == TaskStatus.Open)
query.Where(!Exp.Eq("t.status", TaskStatus.Closed));
else
query.Where("t.status", TaskStatus.Closed);
}
if (participant != Guid.Empty)
{
var existSubtask = new SqlQuery("projects_subtasks pst").Select("pst.task_id").Where(Exp.EqColumns("t.tenant_id", "pst.tenant_id") & Exp.EqColumns("t.id", "pst.task_id") & Exp.Eq("pst.status", TaskStatus.Open));
var existResponsible = new SqlQuery("projects_tasks_responsible ptr1").Select("ptr1.task_id").Where(Exp.EqColumns("t.tenant_id", "ptr1.tenant_id") & Exp.EqColumns("t.id", "ptr1.task_id"));
existSubtask.Where(Exp.Eq("pst.responsible_id", participant.ToString()));
existResponsible.Where(Exp.Eq("ptr1.responsible_id", participant.ToString()));
query.Where(Exp.Exists(existSubtask) | Exp.Exists(existResponsible));
}
return DbManager.ExecuteList(query).ConvertAll(r => ToTask(r));
}
示例3: Terminate
//forceful terminate a behaviour
public void Terminate(Behaviour behaviour, TaskStatus result)
{
behaviour.status = result;
if(behaviour.observer != null){
behaviour.observer();
}
}
示例4: SetTaskComplete
public void SetTaskComplete(TaskStatus status)
{
int statusId = (int)status;
DatabaseProviderFactory factory = new DatabaseProviderFactory();
var db = factory.CreateDefault();
db.ExecuteNonQuery(CommandType.Text, "update app.taskqueue set statusid = " + statusId + ", completedate = '" + DateTime.Now.ToString() + "' where taskQueueId = " + this.TaskQueueId);
}
示例5: 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;
}
示例6: Task
public Task(string name, bool isimportant, bool ishard, int estimatetomato,
TaskType tasktype, TaskPriority taskpri,
TaskStatus taskstatus = TaskStatus.INQUEUE, DateTime? reminder = null)
{
this.name = name;
this.isImportant = isimportant ? "important" : "not important";
this.isHard = ishard ? "hard" : "easy";
this.estimateToamto = estimatetomato;
this.completeTomato = 0;
this.incompleteTomato = 0;
this.innerBreak = 0;
this.outterBreak = 0;
this.completeness = 0;
this.difficulties = 0;
this.satisfaction = 0;
this.efficiency = 0;
this.improvement = 0;
this.achivement = 0;
this.focusness = 0;
this.taskStatus = taskstatus;
this.taskType = tasktype;
this.taskPriority = taskpri;
}
示例7: OnConditionalAbort
public override void OnConditionalAbort(int childIndex)
{
// Start from the beginning on an abort
childrenExecutionOrder.Clear();
executionStatus = TaskStatus.Inactive;
ShuffleChilden();
}
示例8: 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()));
}
示例9: TaskData
public TaskData(JsonObject o)
{
count = Convert.ToInt32(o ["count"]);
killCount = Convert.ToInt32(o ["killCount"]);
createTime = (long)Convert.ToInt64(o ["createtime"]);
prizedTime = (long)Convert.ToInt64(o["finishtime"]);
templateID = Convert.ToInt32(o ["tid"]);
status = (TaskStatus)Convert.ToInt32(o ["status"]);
if (o.ContainsKey("buyCount"))
{
buyCount = Convert.ToInt32(o ["buyCount"]);
}
if (o.ContainsKey("buyTime"))
{
buyTime = (long)Convert.ToInt64(o ["buyTime"]);
}
taskType = (TaskMechanism)Convert.ToInt32(o ["taskType"]);
if (o.ContainsKey("starLevel"))
{
starLevel = Convert.ToInt32(o["starLevel"]);
}
}
示例10: TaskStatusChanged
public TaskStatusChanged(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, TaskStatus status)
{
this.TenantId = tenantId;
this.BacklogItemId = backlogItemId;
this.TaskId = taskId;
this.Status = status;
}
示例11: AcknowledgeStatusUpdate
public Status AcknowledgeStatusUpdate(TaskStatus status)
{
var statusBytes = ProtoBufHelper.Serialize(status);
using (var pinned = MarshalHelper.CreatePinnedObject(statusBytes))
return (Status)NativeImports.SchedulerDriver.AcknowledgeStatusUpdate(_nativeDriverPtr, pinned.Ptr);
}
示例12: InternalRun
internal void InternalRun()
{
FCurrent = this;
try
{
this.OnStarted();
try
{
this.FStatus = TaskStatus.Running;
this.Run();
this.FStatus = ((this.FInternalState & InternalState.CancellationConfirmed) > 0) ? TaskStatus.Canceled : TaskStatus.RanToCompletion;
}
catch (OperationCanceledException)
{
this.FStatus = TaskStatus.Canceled;
}
catch (System.Exception exception)
{
this.FException = exception;
this.FStatus = TaskStatus.Faulted;
if (!this.OnError(exception))
{
throw;
}
}
finally
{
this.OnFinished();
}
}
finally
{
FCurrent = null;
}
}
示例13: ChangeStatus
public Subtask ChangeStatus(Task task, Subtask subtask, TaskStatus newStatus)
{
if (subtask == null) throw new Exception("subtask.Task");
if (task == null) throw new ArgumentNullException("task");
if (task.Status == TaskStatus.Closed) throw new Exception("task can't be closed");
if (subtask.Status == newStatus) return subtask;
ProjectSecurity.DemandEdit(task, subtask);
subtask.Status = newStatus;
subtask.LastModifiedBy = SecurityContext.CurrentAccount.ID;
subtask.LastModifiedOn = TenantUtil.DateTimeNow();
subtask.StatusChangedOn = TenantUtil.DateTimeNow();
if (subtask.Responsible.Equals(Guid.Empty))
subtask.Responsible = SecurityContext.CurrentAccount.ID;
var senders = GetSubscribers(task);
if (task.Status != TaskStatus.Closed && newStatus == TaskStatus.Closed && !factory.DisableNotifications && senders.Count != 0)
NotifyClient.Instance.SendAboutSubTaskClosing(senders, task, subtask);
if (task.Status != TaskStatus.Closed && newStatus == TaskStatus.Open && !factory.DisableNotifications && senders.Count != 0)
NotifyClient.Instance.SendAboutSubTaskResumed(senders, task, subtask);
return subtaskDao.Save(subtask);
}
示例14: ReportStatus
public static void ReportStatus(string taskName, TaskStatus status)
{
if (_statuses.ContainsKey(taskName))
throw new ArgumentOutOfRangeException("taskName", taskName, "Already reported status for this task.");
_statuses.Add(taskName, status);
}
示例15: OnChildExecuted
public override void OnChildExecuted(int childIndex, TaskStatus childStatus)
{
// The child status will be inactive immediately following an abort from OnReevaluationEnded. Ignore that status.
if (childStatus != TaskStatus.Inactive) {
executionStatus = childStatus;
}
}