Ejemplo n.º 1
0
 internal static DkmClrValue GetPropertyValue(
     this DkmClrValue value,
     string name,
     DkmInspectionContext inspectionContext
     )
 {
     return(value.GetMemberValue(
                name,
                (int)MemberTypes.Property,
                ParentTypeName: null,
                InspectionContext: inspectionContext
                ));
 }
Ejemplo n.º 2
0
 internal static DkmClrValue GetMemberValue(
     this DkmClrValue value,
     MemberAndDeclarationInfo member,
     DkmInspectionContext inspectionContext
     )
 {
     // Note: GetMemberValue() may return special value when func-eval of properties is disabled.
     return(value.GetMemberValue(
                member.Name,
                (int)member.MemberType,
                member.DeclaringType.FullName,
                inspectionContext
                ));
 }
Ejemplo n.º 3
0
        internal override void GetRows(
            ResultProvider resultProvider,
            ArrayBuilder <EvalResult> rows,
            DkmInspectionContext inspectionContext,
            EvalResultDataItem parent,
            DkmClrValue value,
            int startIndex,
            int count,
            bool visitAll,
            ref int index)
        {
            var memberValue = value.GetMemberValue(_member, inspectionContext);
            var isDynamicDebugViewEmptyException = memberValue.Type.GetLmrType().IsDynamicDebugViewEmptyException();

            if (isDynamicDebugViewEmptyException || memberValue.IsError())
            {
                if (InRange(startIndex, count, index))
                {
                    if (isDynamicDebugViewEmptyException)
                    {
                        var emptyMember = memberValue.Type.GetMemberByName("Empty");
                        memberValue = memberValue.GetMemberValue(emptyMember, inspectionContext);
                    }
                    var row = new EvalResult(Resources.ErrorName, (string)memberValue.HostObjectValue, inspectionContext);
                    rows.Add(row);
                }
                index++;
            }
            else
            {
                var other = MemberExpansion.CreateMemberDataItem(
                    resultProvider,
                    inspectionContext,
                    _member,
                    memberValue,
                    parent,
                    _customTypeInfoMap,
                    ExpansionFlags.IncludeBaseMembers | ExpansionFlags.IncludeResultsView,
                    supportsFavorites: false);
                var expansion = other.Expansion;
                if (expansion != null)
                {
                    expansion.GetRows(resultProvider, rows, inspectionContext, other.ToDataItem(), other.Value, startIndex, count, visitAll, ref index);
                }
            }
        }
Ejemplo n.º 4
0
        private static EvalResult GetMemberRow(
            ResultProvider resultProvider,
            DkmInspectionContext inspectionContext,
            DkmClrValue value,
            MemberAndDeclarationInfo member,
            EvalResultDataItem parent,
            CustomTypeInfoTypeArgumentMap customTypeInfoMap)
        {
            var memberValue = value.GetMemberValue(member, inspectionContext);

            return(CreateMemberDataItem(
                       resultProvider,
                       inspectionContext,
                       member,
                       memberValue,
                       parent,
                       customTypeInfoMap,
                       ExpansionFlags.All));
        }
Ejemplo n.º 5
0
        private static EvalResultDataItem GetMemberRow(
            ResultProvider resultProvider,
            DkmInspectionContext inspectionContext,
            DkmClrValue value,
            MemberAndDeclarationInfo member,
            EvalResultDataItem parent,
            DynamicFlagsMap dynamicFlagsMap)
        {
            var memberValue = value.GetMemberValue(member, inspectionContext);

            return(CreateMemberDataItem(
                       resultProvider,
                       inspectionContext,
                       member,
                       memberValue,
                       parent,
                       dynamicFlagsMap,
                       ExpansionFlags.All));
        }
Ejemplo n.º 6
0
 private static DkmClrValue GetMemberValue(DkmClrValue container, MemberAndDeclarationInfo member, DkmInspectionContext inspectionContext)
 {
     // Note: GetMemberValue() may return special value
     // when func-eval of properties is disabled.
     return(container.GetMemberValue(member.Name, (int)member.MemberType, member.DeclaringType.FullName, inspectionContext));
 }
Ejemplo n.º 7
0
 internal static DkmClrValue GetFieldValue(this DkmClrValue value, string name)
 {
     return(value.GetMemberValue(name, (int)MemberTypes.Field, ParentTypeName: null));
 }