本文整理汇总了C#中Results.TryFindUint方法的典型用法代码示例。如果您正苦于以下问题:C# Results.TryFindUint方法的具体用法?C# Results.TryFindUint怎么用?C# Results.TryFindUint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Results
的用法示例。
在下文中一共展示了Results.TryFindUint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecodeOutputEvent
private OutputMessage DecodeOutputEvent(Results results)
{
// NOTE: the message event is an MI Extension from clrdbg, though we could use in it the future for other debuggers
string text = results.TryFindString("text");
if (string.IsNullOrEmpty(text))
{
Debug.Fail("Bogus message event. Missing 'text' property.");
return null;
}
string sendTo = results.TryFindString("send-to");
if (string.IsNullOrEmpty(sendTo))
{
Debug.Fail("Bogus message event, missing 'send-to' property");
return null;
}
enum_MESSAGETYPE messageType;
switch (sendTo)
{
case "message-box":
messageType = enum_MESSAGETYPE.MT_MESSAGEBOX;
break;
case "output-window":
messageType = enum_MESSAGETYPE.MT_OUTPUTSTRING;
break;
default:
Debug.Fail("Bogus message event. Unexpected 'send-to' property. Ignoring.");
return null;
}
OutputMessage.Severity severity = OutputMessage.Severity.Warning;
switch (results.TryFindString("severity"))
{
case "error":
severity = OutputMessage.Severity.Error;
break;
case "warning":
severity = OutputMessage.Severity.Warning;
break;
}
switch (results.TryFindString("source"))
{
case "target-exception":
messageType |= enum_MESSAGETYPE.MT_REASON_EXCEPTION;
break;
case "jmc-prompt":
messageType |= (enum_MESSAGETYPE)enum_MESSAGETYPE90.MT_REASON_JMC_PROMPT;
break;
case "step-filter":
messageType |= (enum_MESSAGETYPE)enum_MESSAGETYPE90.MT_REASON_STEP_FILTER;
break;
case "fatal-error":
messageType |= (enum_MESSAGETYPE)enum_MESSAGETYPE120.MT_FATAL_ERROR;
break;
}
uint errorCode = results.TryFindUint("error-code") ?? 0;
return new OutputMessage(text, messageType, severity, errorCode);
}