本文整理汇总了C#中Microsoft.VisualStudio.Debugger.Metadata.Type.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.VisualStudio.Debugger.Metadata.Type.Equals方法的具体用法?C# Microsoft.VisualStudio.Debugger.Metadata.Type.Equals怎么用?C# Microsoft.VisualStudio.Debugger.Metadata.Type.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudio.Debugger.Metadata.Type
的用法示例。
在下文中一共展示了Microsoft.VisualStudio.Debugger.Metadata.Type.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDataItem
internal EvalResultDataItem CreateDataItem(
DkmInspectionContext inspectionContext,
string name,
Type typeDeclaringMember,
Type declaredType,
DkmClrValue value,
EvalResultDataItem parent,
ExpansionFlags expansionFlags,
bool childShouldParenthesize,
string fullName,
ReadOnlyCollection<string> formatSpecifiers,
DkmEvaluationResultCategory category,
DkmEvaluationResultFlags flags,
DkmEvaluationFlags evalFlags)
{
if ((evalFlags & DkmEvaluationFlags.ShowValueRaw) != 0)
{
formatSpecifiers = Formatter.AddFormatSpecifier(formatSpecifiers, "raw");
}
Expansion expansion;
// If the declared type is Nullable<T>, the value should
// have no expansion if null, or be expanded as a T.
var lmrNullableTypeArg = declaredType.GetNullableTypeArgument();
if (lmrNullableTypeArg != null && !value.HasExceptionThrown(parent))
{
Debug.Assert(value.Type.GetProxyType() == null);
var nullableValue = value.GetNullableValue();
if (nullableValue == null)
{
Debug.Assert(declaredType.Equals(value.Type.GetLmrType()));
// No expansion of "null".
expansion = null;
}
else
{
value = nullableValue;
Debug.Assert(lmrNullableTypeArg.Equals(value.Type.GetLmrType())); // If this is not the case, add a test for includeRuntimeTypeIfNecessary.
expansion = this.GetTypeExpansion(inspectionContext, lmrNullableTypeArg, value, ExpansionFlags.IncludeResultsView);
}
}
else if (value.IsError() || (inspectionContext.EvaluationFlags & DkmEvaluationFlags.NoExpansion) != 0)
{
expansion = null;
}
else
{
expansion = DebuggerTypeProxyExpansion.CreateExpansion(
this,
inspectionContext,
name,
typeDeclaringMember,
declaredType,
value,
childShouldParenthesize,
fullName,
flags.Includes(DkmEvaluationResultFlags.ExceptionThrown) ? null : fullName,
formatSpecifiers,
flags,
this.Formatter.GetEditableValue(value));
if (expansion == null)
{
var expansionType = value.HasExceptionThrown(parent) ? value.Type.GetLmrType() : declaredType;
expansion = this.GetTypeExpansion(inspectionContext, expansionType, value, expansionFlags);
}
}
return new EvalResultDataItem(
name,
typeDeclaringMember,
declaredType,
value,
expansion,
childShouldParenthesize,
fullName,
flags.Includes(DkmEvaluationResultFlags.ExceptionThrown) ? null : fullName,
formatSpecifiers,
category,
flags,
this.Formatter.GetEditableValue(value));
}