Ejemplo n.º 1
0
        private string FormatPrimitive(
            DkmClrValue value,
            ObjectDisplayOptions options,
            DkmInspectionContext inspectionContext
            )
        {
            Debug.Assert(value != null);
            // check if HostObjectValue is null, since any of these types might actually be a synthetic value as well.
            if (value.HostObjectValue == null)
            {
                return(_hostValueNotFoundString);
            }

            // DateTime is primitive in VB but not in C#.
            object obj;

            if (value.Type.GetLmrType().IsDateTime())
            {
                var dateDataValue = value.GetPropertyValue("Ticks", inspectionContext);
                obj = new DateTime((long)dateDataValue.HostObjectValue);
            }
            else
            {
                obj = value.HostObjectValue;
            }

            return(FormatPrimitiveObject(obj, options));
        }
Ejemplo n.º 2
0
        private string FormatPrimitive(DkmClrValue value, ObjectDisplayOptions options, DkmInspectionContext inspectionContext)
        {
            Debug.Assert(value != null);

            object obj;

            if (value.Type.GetLmrType().IsDateTime())
            {
                DkmClrValue dateDataValue = value.GetPropertyValue("Ticks", inspectionContext);
                Debug.Assert(dateDataValue.HostObjectValue != null);

                obj = new DateTime((long)dateDataValue.HostObjectValue);
            }
            else
            {
                Debug.Assert(value.HostObjectValue != null);
                obj = value.HostObjectValue;
            }

            return(FormatPrimitiveObject(obj, options));
        }