本文整理汇总了C#中Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue.GetValueString方法的典型用法代码示例。如果您正苦于以下问题:C# DkmClrValue.GetValueString方法的具体用法?C# DkmClrValue.GetValueString怎么用?C# DkmClrValue.GetValueString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue
的用法示例。
在下文中一共展示了DkmClrValue.GetValueString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryFormatValue
/// <summary>
/// This method is called by the debug engine to populate the text representing the value
/// of an expression.
/// </summary>
/// <param name="clrValue">The raw value to get the text for</param>
/// <param name="inspectionContext">Context of the evaluation. This contains options/flags
/// to be used during compilation. It also contains the InspectionSession. The inspection
/// session is the object that provides lifetime management for our objects. When the user
/// steps or continues the process, the debug engine will dispose of the inspection session</param>
/// <param name="formatSpecifiers"></param>
/// <returns>The text representing the given value</returns>
string IDkmClrFormatter.GetValueString(DkmClrValue clrValue, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
{
DkmClrType clrType = clrValue.Type;
if (clrType == null)
{
// This can be null in some error cases
return string.Empty;
}
// Try to format the value. If we can't format the value, delegate to the C# Formatter.
string value = TryFormatValue(clrValue, inspectionContext);
return value ?? clrValue.GetValueString(inspectionContext, formatSpecifiers);
}
示例2:
string IDkmClrFormatter.GetValueString(DkmClrValue clrValue, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
{
return clrValue.GetValueString(inspectionContext, formatSpecifiers);
}
示例3: CreateRawViewRow
private EvalResult CreateRawViewRow(
ResultProvider resultProvider,
DkmInspectionContext inspectionContext,
EvalResultDataItem parent,
DkmClrValue value)
{
var displayName = Resources.RawView;
var displayValue = value.GetValueString(inspectionContext, Formatter.NoFormatSpecifiers);
var displayType = ResultProvider.GetTypeName(
inspectionContext,
value,
_typeAndInfo.ClrType,
_typeAndInfo.Info,
isPointerDereference: false);
var expansion = new TupleExpansion(_typeAndInfo, _cardinality, useRawView: true);
return new EvalResult(
ExpansionKind.Explicit,
displayName,
default(TypeAndCustomInfo),
_typeAndInfo,
useDebuggerDisplay: false,
value: value,
displayValue: displayValue,
expansion: expansion,
childShouldParenthesize: parent.ChildShouldParenthesize,
fullName: parent.FullNameWithoutFormatSpecifiers,
childFullNamePrefixOpt: parent.ChildFullNamePrefix,
formatSpecifiers: Formatter.AddFormatSpecifier(parent.FormatSpecifiers, "raw"),
category: DkmEvaluationResultCategory.Data,
flags: DkmEvaluationResultFlags.ReadOnly,
editableValue: null,
inspectionContext: inspectionContext,
displayName: displayName,
displayType: displayType);
}
示例4:
string IDkmClrFormatter2.GetValueString(DkmClrValue value, DkmClrCustomTypeInfo customTypeInfo, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
{
return value.GetValueString(inspectionContext, formatSpecifiers);
}