本文整理汇总了C#中Task.SetSubject方法的典型用法代码示例。如果您正苦于以下问题:C# Task.SetSubject方法的具体用法?C# Task.SetSubject怎么用?C# Task.SetSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.SetSubject方法的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: LastUpdateTime
public void LastUpdateTime()
{
var a = this.CreateAccount();
var task = new Task(a);
//subjet
var old = task.LastUpdateTime;
this.Idle();
task.SetSubject(task.Subject);
Assert.AreEqual(task.LastUpdateTime, old);
task.SetSubject(string.Empty);
Assert.Greater(task.LastUpdateTime, old);
//body
old = task.LastUpdateTime;
this.Idle();
task.SetBody(task.Body);
Assert.AreEqual(task.LastUpdateTime, old);
task.SetBody(string.Empty);
Assert.Greater(task.LastUpdateTime, old);
//dueTime
old = task.LastUpdateTime;
this.Idle();
task.SetDueTime(null);
Assert.Greater(task.LastUpdateTime, old);
//priority
old = task.LastUpdateTime;
this.Idle();
task.SetPriority(task.Priority);
Assert.AreEqual(task.LastUpdateTime, old);
task.SetPriority(Priority.Upcoming);
Assert.Greater(task.LastUpdateTime, old);
//tasklist
old = task.LastUpdateTime;
this.Idle();
var list = this.CreatePersonalTasklist(a);
task.SetTasklist(list);
Assert.Greater(task.LastUpdateTime, old);
old = task.LastUpdateTime;
task.SetTasklist(list);
Assert.AreEqual(task.LastUpdateTime, old);
}
示例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);
}