本文整理汇总了C#中IUser.RaiseError方法的典型用法代码示例。如果您正苦于以下问题:C# IUser.RaiseError方法的具体用法?C# IUser.RaiseError怎么用?C# IUser.RaiseError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUser
的用法示例。
在下文中一共展示了IUser.RaiseError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scan
/// <summary>
/// Scans the ksp instance. Detects installed mods to mark as auto-detected and checks the consistency
/// </summary>
/// <param name="ksp_instance">The instance to scan</param>
/// <param name="user"></param>
/// <param name="next_command">Changes the output message if set.</param>
/// <returns>Exit.OK if instance is consistent, Exit.ERROR otherwise </returns>
private static int Scan(CKAN.KSP ksp_instance, IUser user, string next_command=null)
{
try
{
ksp_instance.ScanGameData();
return Exit.OK;
}
catch (InconsistentKraken kraken)
{
if (next_command==null)
{
user.RaiseError(kraken.InconsistenciesPretty);
user.RaiseError("The repo has not been saved.");
}
else
{
user.RaiseMessage("Preliminary scanning shows that the install is in a inconsistent state.");
user.RaiseMessage("Use ckan.exe scan for more details");
user.RaiseMessage("Proceeding with {0} in case it fixes it.\n", next_command);
}
return Exit.ERROR;
}
}