Example #1
0
 internal static Expansion CreateExpansion(
     MemberAndDeclarationInfo members,
     DynamicFlagsMap dynamicFlagsMap)
 {
     return new RootHiddenExpansion(members, dynamicFlagsMap);
 }
Example #2
0
 internal static EvalResult CreateMemberDataItem(
     ResultProvider resultProvider,
     DkmInspectionContext inspectionContext,
     MemberAndDeclarationInfo member,
     DkmClrValue memberValue,
     EvalResultDataItem parent,
     CustomTypeInfoTypeArgumentMap customTypeInfoMap,
     ExpansionFlags flags)
 {
     var fullNameProvider = resultProvider.FullNameProvider;
     var declaredType = member.Type;
     var declaredTypeInfo = customTypeInfoMap.SubstituteCustomTypeInfo(member.OriginalDefinitionType, member.TypeInfo);
     string memberName;
     // Considering, we're not handling the case of a member inherited from a generic base type.
     var typeDeclaringMember = member.GetExplicitlyImplementedInterface(out memberName) ?? member.DeclaringType;
     var typeDeclaringMemberInfo = typeDeclaringMember.IsInterface
         ? customTypeInfoMap.SubstituteCustomTypeInfo(typeDeclaringMember.GetInterfaceListEntry(member.DeclaringType), customInfo: null)
         : null;
     var memberNameForFullName = fullNameProvider.GetClrValidIdentifier(inspectionContext, memberName);
     var appDomain = memberValue.Type.AppDomain;
     string fullName;
     if (memberNameForFullName == null)
     {
         fullName = null;
     }
     else
     {
         memberName = memberNameForFullName;
         fullName = MakeFullName(
                fullNameProvider,
                inspectionContext,
                memberNameForFullName,
                new TypeAndCustomInfo(DkmClrType.Create(appDomain, typeDeclaringMember), typeDeclaringMemberInfo), // Note: Won't include DynamicAttribute.
                member.RequiresExplicitCast,
                member.IsStatic,
                parent);
     }
     return resultProvider.CreateDataItem(
         inspectionContext,
         memberName,
         typeDeclaringMemberAndInfo: (member.IncludeTypeInMemberName || typeDeclaringMember.IsInterface) ? new TypeAndCustomInfo(DkmClrType.Create(appDomain, typeDeclaringMember), typeDeclaringMemberInfo) : default(TypeAndCustomInfo), // Note: Won't include DynamicAttribute.
         declaredTypeAndInfo: new TypeAndCustomInfo(DkmClrType.Create(appDomain, declaredType), declaredTypeInfo),
         value: memberValue,
         useDebuggerDisplay: parent != null,
         expansionFlags: flags,
         childShouldParenthesize: false,
         fullName: fullName,
         formatSpecifiers: Formatter.NoFormatSpecifiers,
         category: DkmEvaluationResultCategory.Other,
         flags: memberValue.EvalFlags,
         evalFlags: DkmEvaluationFlags.None);
 }
Example #3
0
 internal RootHiddenExpansion(MemberAndDeclarationInfo member, DynamicFlagsMap dynamicFlagsMap)
 {
     _member = member;
     _dynamicFlagsMap = dynamicFlagsMap;
 }
Example #4
0
        private MemberExpansion(MemberAndDeclarationInfo[] members, CustomTypeInfoTypeArgumentMap customTypeInfoMap)
        {
            Debug.Assert(members != null);
            Debug.Assert(members.Length > 0);
            Debug.Assert(customTypeInfoMap != null);

            _members = members;
            _customTypeInfoMap = customTypeInfoMap;
        }
Example #5
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);
 }
Example #6
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);
 }
Example #7
0
 internal static EvalResultDataItem CreateMemberDataItem(
     ResultProvider resultProvider,
     DkmInspectionContext inspectionContext,
     MemberAndDeclarationInfo member,
     DkmClrValue memberValue,
     EvalResultDataItem parent,
     DynamicFlagsMap dynamicFlagsMap,
     ExpansionFlags flags)
 {
     var declaredType = member.Type;
     var declaredTypeInfo = dynamicFlagsMap.SubstituteDynamicFlags(member.OriginalDefinitionType, DynamicFlagsCustomTypeInfo.Create(member.TypeInfo)).GetCustomTypeInfo();
     string memberName;
     // Considering, we're not handling the case of a member inherited from a generic base type.
     var typeDeclaringMember = member.GetExplicitlyImplementedInterface(out memberName) ?? member.DeclaringType;
     var typeDeclaringMemberInfo = typeDeclaringMember.IsInterface
         ? dynamicFlagsMap.SubstituteDynamicFlags(typeDeclaringMember.GetInterfaceListEntry(member.DeclaringType), originalDynamicFlags: default(DynamicFlagsCustomTypeInfo)).GetCustomTypeInfo()
         : null;
     var formatter = resultProvider.Formatter;
     memberName = formatter.GetIdentifierEscapingPotentialKeywords(memberName);
     var fullName = MakeFullName(
         formatter,
         memberName,
         new TypeAndCustomInfo(typeDeclaringMember, typeDeclaringMemberInfo), // Note: Won't include DynamicAttribute.
         member.RequiresExplicitCast,
         member.IsStatic,
         parent);
     return resultProvider.CreateDataItem(
         inspectionContext,
         memberName,
         typeDeclaringMemberAndInfo: (member.IncludeTypeInMemberName || typeDeclaringMember.IsInterface) ? new TypeAndCustomInfo(typeDeclaringMember, typeDeclaringMemberInfo) : default(TypeAndCustomInfo), // Note: Won't include DynamicAttribute.
         declaredTypeAndInfo: new TypeAndCustomInfo(declaredType, declaredTypeInfo),
         value: memberValue,
         parent: parent,
         expansionFlags: flags,
         childShouldParenthesize: false,
         fullName: fullName,
         formatSpecifiers: Formatter.NoFormatSpecifiers,
         category: DkmEvaluationResultCategory.Other,
         flags: memberValue.EvalFlags,
         evalFlags: DkmEvaluationFlags.None);
 }
Example #8
0
        private MemberExpansion(MemberAndDeclarationInfo[] members, DynamicFlagsMap dynamicFlagsMap)
        {
            Debug.Assert(members != null);
            Debug.Assert(members.Length > 0);
            Debug.Assert(dynamicFlagsMap != null);

            _members = members;
            _dynamicFlagsMap = dynamicFlagsMap;
        }
Example #9
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);
 }
Example #10
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);
 }
Example #11
0
 internal static Expansion CreateExpansion(
     MemberAndDeclarationInfo members,
     CustomTypeInfoTypeArgumentMap customTypeInfoMap)
 {
     return new RootHiddenExpansion(members, customTypeInfoMap);
 }
Example #12
0
 internal RootHiddenExpansion(MemberAndDeclarationInfo member, CustomTypeInfoTypeArgumentMap customTypeInfoMap)
 {
     _member = member;
     _customTypeInfoMap = customTypeInfoMap;
 }