/// <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
0
 string IDkmClrFormatter.GetValueString(DkmClrValue clrValue, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
 {
     return clrValue.GetValueString(inspectionContext, formatSpecifiers);
 }
Пример #3
0
 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
0
 string IDkmClrFormatter2.GetValueString(DkmClrValue value, DkmClrCustomTypeInfo customTypeInfo, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
 {
     return value.GetValueString(inspectionContext, formatSpecifiers);
 }