private static DkmEvaluationResultFlags GetFlags(DkmClrValue value, DkmInspectionContext inspectionContext)
        {
            if (value == null)
            {
                return(DkmEvaluationResultFlags.None);
            }

            var resultFlags = value.EvalFlags;
            var type        = value.Type.GetLmrType();

            if (type.IsBoolean())
            {
                resultFlags |= DkmEvaluationResultFlags.Boolean;
                if (true.Equals(value.HostObjectValue))
                {
                    resultFlags |= DkmEvaluationResultFlags.BooleanTrue;
                }
            }

            if (!value.IsError() && value.HasUnderlyingString(inspectionContext))
            {
                resultFlags |= DkmEvaluationResultFlags.RawString;
            }

            // As in the old EE, we won't allow editing members of a DynamicView expansion.
            if (type.IsDynamicProperty())
            {
                resultFlags |= DkmEvaluationResultFlags.ReadOnly;
            }

            return(resultFlags);
        }
        private static DkmEvaluationResultFlags GetFlags(DkmClrValue value, DkmInspectionContext inspectionContext)
        {
            if (value == null)
            {
                return(DkmEvaluationResultFlags.None);
            }

            var resultFlags = value.EvalFlags;
            var type        = value.Type.GetLmrType();

            if (type.IsBoolean())
            {
                resultFlags |= DkmEvaluationResultFlags.Boolean;
                if (true.Equals(value.HostObjectValue))
                {
                    resultFlags |= DkmEvaluationResultFlags.BooleanTrue;
                }
            }

            if (!value.IsError() && value.HasUnderlyingString(inspectionContext))
            {
                resultFlags |= DkmEvaluationResultFlags.RawString;
            }

            return(resultFlags);
        }
Exemple #3
0
 bool IDkmClrFormatter.HasUnderlyingString(
     DkmClrValue clrValue,
     DkmInspectionContext inspectionContext
     )
 {
     return(clrValue.HasUnderlyingString(inspectionContext));
 }
 /// <summary>
 /// This method is called by the debug engine to determine if a value has an underlying
 /// string.  If so, the debugger will show a magnifying glass icon next to the value.  The
 /// user can then use it to select a text visualizer.
 /// </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>
 /// <returns></returns>
 bool IDkmClrFormatter.HasUnderlyingString(DkmClrValue clrValue, DkmInspectionContext inspectionContext)
 {
     // The C# behavior is good enough for our purposes.
     return(clrValue.HasUnderlyingString(inspectionContext));
 }