Inheritance: IDocumentationMember
Beispiel #1
0
        public void Add( List<Namespace> namespaces, DocumentedType association )
        {
            try
            {
                if( null != namespaces && null != association )
                {
                    var ns = FindNamespace( association, namespaces );
                    if( null != ns )
                    {
                        DeclaredType doc = DeclaredType.Unresolved( (TypeIdentifier) association.Name, association.TargetType, ns );
                        if( null != doc )
                        {
                            ParseSummary( association, doc );
                            ParseRemarks( association, doc );
                            ParseValue( association, doc );
                            ParseExample( association, doc );

                            if( matchedAssociations.ContainsKey( association.Name ) ) return;

                            matchedAssociations.Add( association.Name, doc );
                            ns.AddType( doc );
                        }
                    }
                }
            }
            catch( Exception ) { }
        }
        private void ParseType(IList<IDocumentationMember> members, XmlNode node)
        {
            Identifier member = Identifier.FromString(node.Attributes["name"].Value);

            for (int i = 0; i < members.Count; i++)
            {
                var typeMember = members[i] as UndocumentedType;

                if (typeMember != null && typeMember.Match(member))
                    members[i] = new DocumentedType(member, node, typeMember.Type);
            }
        }
Beispiel #3
0
        public void Add(List<Namespace> namespaces, DocumentedType association)
        {
            var ns = FindNamespace(association, namespaces);
            DeclaredType doc = DeclaredType.Unresolved((TypeIdentifier)association.Name, association.TargetType, ns);

            ParseSummary(association, doc);
            ParseRemarks(association, doc);
            ParseValue(association, doc);

            if (matchedAssociations.ContainsKey(association.Name))
                return; // weird case when a type has the same method declared twice

            matchedAssociations.Add(association.Name, doc);
            ns.AddType(doc);
        }
Beispiel #4
0
        public void Add(List<Namespace> namespaces, DocumentedType association)
        {
            Namespace ns = this.FindNamespace(association, namespaces);
            DeclaredType doc = DeclaredType.Unresolved((TypeIdentifier)association.Name, association.TargetType, ns);

            this.ParseSummary(association, doc);
            this.ParseRemarks(association, doc);
            this.ParseValue(association, doc);
            this.ParseExample(association, doc);

            if (this.matchedAssociations.ContainsKey(association.Name))
            {
                return;
            }

            this.matchedAssociations.Add(association.Name, doc);
            ns.AddType(doc);
        }
Beispiel #5
0
        static void MatchType(List<IDocumentationMember> members, XmlNode node)
        {
            var identifier = IdentifierFor.XmlString(node.Attributes["name"].Value);
            var positionOfUndocumentedType = members.FindIndex(m =>
                {
                    var reflected = m as ReflectedType;
                    return reflected != null && reflected.Match(identifier);
                });

            if (positionOfUndocumentedType >= 0)
            {
                members[positionOfUndocumentedType] = new DocumentedType(identifier, node, members[positionOfUndocumentedType].TargetType);
            }
        }
        private void ParseType(List<IDocumentationMember> members, XmlNode node)
        {
            var identifier = Identifier.FromString(node.Attributes["name"].Value);
            var positionOfUndocumentedType = members.FindIndex(m =>
            {
                var typeMember = m as UndocumentedType;
                return typeMember != null && typeMember.Match(identifier);
            });

            if (positionOfUndocumentedType >= 0)
            {
                members[positionOfUndocumentedType] = new DocumentedType(identifier, node, members[positionOfUndocumentedType].TargetType);
            }
        }
Beispiel #7
0
        private void AddType(List<Namespace> namespaces, List<IReferencable> references, DocumentedType association)
        {
            NamespaceIdentifier namespaceName = Identifier.FromNamespace(association.Type.Namespace);
            Namespace @namespace = namespaces.Find(x => x.IsIdentifiedBy(namespaceName));
            DeclaredType doc = DeclaredType.Unresolved((TypeIdentifier)association.Name, association.Type, @namespace);

            if (association.Xml != null)
            {
                XmlNode summaryNode = association.Xml.SelectSingleNode("summary");

                if (summaryNode != null)
                    doc.Summary = commentContentParser.Parse(summaryNode);

                GetReferencesFromComment(references, doc.Summary);
            }

            if (matchedAssociations.ContainsKey(association.Name))
                return; // weird case when a type has the same method declared twice

            references.Add(doc);
            matchedAssociations.Add(association.Name, doc);
            @namespace.AddType(doc);
        }
Beispiel #8
0
        private void AddNamespace(List<Namespace> namespaces, DocumentedType association)
        {
            var ns = Identifier.FromNamespace(association.Type.Namespace);

            if (!namespaces.Exists(x => x.IsIdentifiedBy(ns)))
            {
                var doc = new Namespace(ns);
                matchedAssociations.Add(association.Name.CloneAsNamespace(), doc);
                namespaces.Add(doc);
            }
        }