本文整理汇总了C#中Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue.GetExceptionMessage方法的典型用法代码示例。如果您正苦于以下问题:C# DkmClrValue.GetExceptionMessage方法的具体用法?C# DkmClrValue.GetExceptionMessage怎么用?C# DkmClrValue.GetExceptionMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue
的用法示例。
在下文中一共展示了DkmClrValue.GetExceptionMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateResultsOnlyRow
internal static EvalResult CreateResultsOnlyRow(
DkmInspectionContext inspectionContext,
string name,
string fullName,
ReadOnlyCollection<string> formatSpecifiers,
DkmClrType declaredType,
DkmClrCustomTypeInfo declaredTypeInfo,
DkmClrValue value,
ResultProvider resultProvider)
{
string errorMessage;
if (value.IsError())
{
errorMessage = (string)value.HostObjectValue;
}
else if (value.HasExceptionThrown())
{
errorMessage = value.GetExceptionMessage(inspectionContext, name);
}
else
{
var enumerableType = GetEnumerableType(value);
if (enumerableType != null)
{
var expansion = CreateExpansion(inspectionContext, value, enumerableType, resultProvider);
if (expansion != null)
{
return expansion.CreateResultsViewRow(
inspectionContext,
name,
fullName,
formatSpecifiers,
new TypeAndCustomInfo(declaredType, declaredTypeInfo),
value,
includeResultsFormatSpecifier: true,
fullNameProvider: resultProvider.FullNameProvider);
}
errorMessage = Resources.ResultsViewNoSystemCore;
}
else
{
errorMessage = Resources.ResultsViewNotEnumerable;
}
}
Debug.Assert(errorMessage != null);
return new EvalResult(name, errorMessage, inspectionContext);
}
示例2: CreateResultsOnly
internal static DkmEvaluationResult CreateResultsOnly(
string name,
DkmClrType declaredType,
DkmClrValue value,
EvalResultDataItem parent,
Formatter formatter)
{
string errorMessage;
if (value.IsError())
{
errorMessage = (string)value.HostObjectValue;
}
else if (value.HasExceptionThrown(parent))
{
errorMessage = value.GetExceptionMessage(name, formatter);
}
else
{
var enumerableType = GetEnumerableType(value);
if (enumerableType != null)
{
var expansion = CreateExpansion(value, enumerableType, formatter);
if (expansion != null)
{
return expansion.CreateEvaluationResult(name, parent, formatter);
}
errorMessage = Resources.ResultsViewNoSystemCore;
}
else
{
errorMessage = Resources.ResultsViewNotEnumerable;
}
}
Debug.Assert(errorMessage != null);
return DkmFailedEvaluationResult.Create(
InspectionContext: value.InspectionContext,
StackFrame: value.StackFrame,
Name: name,
FullName: null,
ErrorMessage: errorMessage,
Flags: DkmEvaluationResultFlags.None,
Type: null,
DataItem: null);
}