本文整理汇总了C#中Interfaces.errorOutput方法的典型用法代码示例。如果您正苦于以下问题:C# Interfaces.errorOutput方法的具体用法?C# Interfaces.errorOutput怎么用?C# Interfaces.errorOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interfaces
的用法示例。
在下文中一共展示了Interfaces.errorOutput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: attemptTask
/// <summary>
/// Attempts the task. Returns true if the lesson is finished
/// a false return means you should refresh the task.
/// </summary>
/// <returns><c>true</c>, if task was attempted,
/// <c>false</c> otherwise.</returns>
/// <param name="command">Command.</param>
/// <param name="args">Arguments.</param>
public bool attemptTask(string command, string[] args,
Interfaces.iModule mod)
{
cleanOnRun ();
string disallowedArg = disallowedCheck (args);
if (disallowedArg != null) {
throw new ArgumentException
("ERROR: Your command contains a disallowed argument: "
+ disallowedArg);
}
if (mod.unsupportedCommand(command, args))
{
throw new ArgumentException
("This command is unsupported by the module");
}
mod.run (command, args);
string comparison = mod.standardOutput ();
lastStandardOutput = mod.standardOutput ();
lastErrorOutput = mod.errorOutput ();
lastResultCode = mod.resultCode ();
if (isSandbox)
return false;
if (activeTask.errorToTask)
comparison = mod.errorOutput ();
if (activeTask.commandToTask) {
comparison = command + " ";
foreach (string s in args) {
comparison += s + " ";
}
comparison = comparison.TrimEnd ();
}
if (activeTask.errorToTask && activeTask.commandToTask)
comparison = mod.errorOutput ()
+ Environment.NewLine
+ Environment.NewLine
+ command;
if (activeTask.hasPassed (comparison) && isLastTask)
return true;
if (activeTask.hasPassed (comparison) && isLastTask == false)
{
activeTask = Tasks [currentTaskNo + 1];
return false;
}
if (activeTask.hasPassed (comparison) == false)
return false;
throw new Exception ("An unknown exception ocurred in the lesson flow");
}