コード例 #1
0
        private XElement CreateMemberElement(InvolvedTypeMember member)
        {
            MemberInfo memberInfo = member.MemberInfo;

            var memberModifier = _memberModifierUtility.GetMemberModifiers(memberInfo);

            if (memberModifier.Contains("private")) // memberModifier.Contains ("internal")
            {
                return(null);
            }

            var memberName = GetMemberName(memberInfo);

            var attributes = new StringBuilder();

            XElement overridesElement  = null;
            XElement overriddenElement = null;

            if (_involvedType != null)
            {
                if (HasOverrideMixinAttribute(memberInfo))
                {
                    attributes.Append("OverrideMixin ");
                }
                if (HasOverrideTargetAttribute(memberInfo))
                {
                    attributes.Append("OverrideTarget ");
                }

                overridesElement  = CreateOverridesElement(member);
                overriddenElement = CreateOverriddenElement(member.MemberInfo);
            }

            if (memberInfo.DeclaringType != _type &&
                overridesElement == null && overriddenElement == null)
            {
                return(null);
            }

            var element = new XElement("Member", new XAttribute("id", _memberIdentifierGenerator.GetIdentifier(memberInfo)),
                                       new XAttribute("metadataToken", GetMetadataToken(memberInfo)),
                                       new XAttribute("type", memberInfo.MemberType),
                                       new XAttribute("name", memberName),
                                       new XAttribute("is-declared-by-this-class", memberInfo.DeclaringType == _type),
                                       _outputFormatter.CreateModifierMarkup(attributes.ToString(), memberModifier),
                                       _memberSignatureUtility.GetMemberSignature(memberInfo),
                                       member.SubMemberInfos.Select(CreateSubMemberElement),
                                       overridesElement,
                                       overriddenElement);

            return(element);
        }
コード例 #2
0
        private XElement CreateOverridesElement(InvolvedTypeMember member)
        {
            var overridesElement = new XElement("Overrides");

            var overridingMixinTypes  = member.OverridingMixinTypes;
            var overridingTargetTypes = member.OverridingTargetTypes;

            if (!overridingMixinTypes.Any() && !overridingTargetTypes.Any())
            {
                return(null);
            }

            foreach (var overridingType in overridingMixinTypes)
            {
                overridesElement.Add(CreateInvolvedTypeReferenceElement("Mixin-Reference", overridingType));
            }

            foreach (var overridingType in overridingTargetTypes)
            {
                overridesElement.Add(CreateInvolvedTypeReferenceElement("Target-Reference", overridingType));
            }

            return(overridesElement);
        }
コード例 #3
0
        private XElement CreateMemberElement(InvolvedTypeMember member)
        {
            MemberInfo memberInfo = member.MemberInfo;

              var memberModifier = _memberModifierUtility.GetMemberModifiers (memberInfo);
              if (memberModifier.Contains ("private")) // memberModifier.Contains ("internal")
            return null;

              var memberName = GetMemberName(memberInfo);

              var attributes = new StringBuilder ();

              XElement overridesElement = null;
              XElement overriddenElement = null;
              if (_involvedType != null)
              {
            if (HasOverrideMixinAttribute (memberInfo))
              attributes.Append ("OverrideMixin ");
            if (HasOverrideTargetAttribute (memberInfo))
              attributes.Append ("OverrideTarget ");

            overridesElement = CreateOverridesElement (member);
            overriddenElement = CreateOverriddenElement (member.MemberInfo);
              }

              if (memberInfo.DeclaringType != _type &&
              overridesElement == null && overriddenElement == null)
            return null;

              var element = new XElement("Member", new XAttribute("id", _memberIdentifierGenerator.GetIdentifier(memberInfo)),
                                 new XAttribute("metadataToken", GetMetadataToken(memberInfo)),
                                 new XAttribute("type", memberInfo.MemberType),
                                 new XAttribute("name", memberName),
                                 new XAttribute("is-declared-by-this-class", memberInfo.DeclaringType == _type),
                                 _outputFormatter.CreateModifierMarkup(attributes.ToString(), memberModifier),
                                 _memberSignatureUtility.GetMemberSignature(memberInfo),
                                 member.SubMemberInfos.Select(CreateSubMemberElement),
                                 overridesElement,
                                 overriddenElement);
              return element;
        }
コード例 #4
0
        private XElement CreateOverridesElement(InvolvedTypeMember member)
        {
            var overridesElement = new XElement ("Overrides");

              var overridingMixinTypes = member.OverridingMixinTypes;
              var overridingTargetTypes = member.OverridingTargetTypes;

              if (!overridingMixinTypes.Any () && !overridingTargetTypes.Any ())
            return null;

              foreach (var overridingType in overridingMixinTypes)
            overridesElement.Add (CreateInvolvedTypeReferenceElement ("Mixin-Reference", overridingType));

              foreach (var overridingType in overridingTargetTypes)
            overridesElement.Add (CreateInvolvedTypeReferenceElement ("Target-Reference", overridingType));

              return overridesElement;
        }