本文整理汇总了C#中ArgumentList.GetTypeOfChange方法的典型用法代码示例。如果您正苦于以下问题:C# ArgumentList.GetTypeOfChange方法的具体用法?C# ArgumentList.GetTypeOfChange怎么用?C# ArgumentList.GetTypeOfChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentList
的用法示例。
在下文中一共展示了ArgumentList.GetTypeOfChange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(ArgumentList arguments, TaskList tasklist, TagList tags, TagFolder folder)
{
FileIO loader = new FileIO();
switch (arguments.GetTypeOfChange())
{
case 0:
if (tasklist.ChangeTask(arguments.GetParameter(1), arguments.GetParameter(3), 0))
Console.WriteLine("Task {0} changed to {1}", arguments.GetParameter(1), arguments.GetParameter(3));
else
Console.WriteLine("No task with that id found to change");
break;
case 1:
if (tasklist.ChangeTask(arguments.GetParameter(1), arguments.GetParameter(3), 1))
Console.WriteLine("Task {0} due date changed to {1}", arguments.GetParameter(1), arguments.GetParameter(3));
else
Console.WriteLine("No task with that id found to change");
break;
case 2:
if (tasklist.ChangeTask(arguments.GetParameter(1), arguments.GetParameter(3), 0) && tasklist.ChangeTask(arguments.GetParameter(1), arguments.GetParameter(5), 1))
Console.WriteLine("Task {0} changed to {1}, due date changed to {2}", arguments.GetParameter(1), arguments.GetParameter(3), arguments.GetParameter(5));
else
Console.WriteLine("No task with that id found to change");
break;
case 3:
if (tasklist.ChangeTask(arguments.GetParameter(1), arguments.GetParameter(3), 1) && tasklist.ChangeTask(arguments.GetParameter(1), arguments.GetParameter(5), 0))
Console.WriteLine("Task {0} changed to {1}, due date changed to {2}", arguments.GetParameter(1), arguments.GetParameter(5), arguments.GetParameter(3));
else
Console.WriteLine("No task with that id found to change");
break;
default:
Console.WriteLine("Wrong arguments for change command");
break;
}
loader.SaveTasks(tasklist.GetTasks());
}