Beispiel #1
0
        /// <summary>
        /// Creates the appropriate type of member according to the member id prefix.
        /// </summary>
        private static Member CreateMember(string memberId, XElement element, IEnumerable <Element> children)
        {
            var member = default(Member);

            switch (memberId[0])
            {
            case 'T':
                member = new TypeDeclaration(memberId, children);
                break;

            case 'F':
                member = new Field(memberId, children);
                break;

            case 'P':
                member = new Property(memberId, children);
                break;

            case 'M':
                member = new Method(memberId, children);
                break;

            case 'E':
                member = new Event(memberId, children);
                break;

            default:
                member = new UnknownMember(memberId);
                break;
            }

            member.SetLineInfo(element as IXmlLineInfo);
            return(member);
        }
Beispiel #2
0
        /// <summary>
        /// See <see cref="Visitor.VisitUnknownMember"/>.
        /// </summary>
        public override void VisitUnknownMember(UnknownMember member)
        {
            if (delegates.VisitUnknownMember != null)
            {
                delegates.VisitUnknownMember(member);
            }

            base.VisitUnknownMember(member);
        }
Beispiel #3
0
 /// <summary>
 /// Visits an unknown member element.
 /// </summary>
 public virtual void VisitUnknownMember(UnknownMember member) => VisitContainer(member);