本文整理汇总了C#中Task.MarkAsCompleted方法的典型用法代码示例。如果您正苦于以下问题:C# Task.MarkAsCompleted方法的具体用法?C# Task.MarkAsCompleted怎么用?C# Task.MarkAsCompleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.MarkAsCompleted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyUpdate
private void ApplyUpdate(Task t, ChangeLog c)
{
if (c.Name.Equals("subject", StringComparison.InvariantCultureIgnoreCase))
t.SetSubject(c.Value);
if (c.Name.Equals("body", StringComparison.InvariantCultureIgnoreCase))
t.SetBody(c.Value);
if (c.Name.Equals("priority", StringComparison.InvariantCultureIgnoreCase))
t.SetPriority((Priority)Convert.ToInt32(c.Value));
if (c.Name.Equals("duetime", StringComparison.InvariantCultureIgnoreCase))
t.SetDueTime(string.IsNullOrWhiteSpace(c.Value) ? new DateTime?() : Convert.ToDateTime(c.Value));
if (c.Name.Equals("iscompleted", StringComparison.InvariantCultureIgnoreCase))
if (Convert.ToBoolean(c.Value))
t.MarkAsCompleted();
else
t.MarkAsInCompleted();
this._taskService.Update(t);
if (this._log.IsDebugEnabled)
this._log.DebugFormat("为任务#{0}执行变更{1}|{2}|{3}", t.ID, c.ID, c.Name, c.Value);
}
示例2: GetIncompleted
public void GetIncompleted()
{
var a = this.CreateAccount();
var list = this.CreatePersonalTasklist(a);
var task = new Task(a);
this._taskService.Create(task);
task = new Task(a);
task.SetTasklist(list);
this._taskService.Create(task);
task = new Task(a);
task.MarkAsCompleted();
task.SetTasklist(list);
this._taskService.Create(task);
Assert.AreEqual(2, this._taskService.GetIncompletedTasks(a).Count());
Assert.AreEqual(1, this._taskService.GetIncompletedTasks(a, list).Count());
Assert.AreEqual(1, this._taskService.GetIncompletedTasksAndNotBelongAnyTasklist(a).Count());
}
示例3: ApplyUpdate
protected virtual void ApplyUpdate(Task t, ChangeLog c)
{
var n = c.Name.ToLower();
if (n.Equals("subject"))
t.SetSubject(c.Value);
else if (n.Equals("body"))
t.SetBody(c.Value);
else if (n.Equals("priority"))
t.SetPriority((Priority)Convert.ToInt32(c.Value));
else if (n.Equals("duetime"))
t.SetDueTime(string.IsNullOrWhiteSpace(c.Value) ? new DateTime?() : Convert.ToDateTime(c.Value));
else if (n.Equals("iscompleted"))
if (Convert.ToBoolean(c.Value))
t.MarkAsCompleted();
else
t.MarkAsInCompleted();
else if (n.Equals("tags"))
if (c.Type == ChangeType.Insert)
t.AddTag(c.Value);
else if (c.Type == ChangeType.Delete)
t.RemoveTag(c.Value);
}