Inheritance: IDocumentationMember
示例#1
0
        public void Add(List<Namespace> namespaces, DocumentedProperty association)
        {
            if (association.Property == null) return;

            var ns = FindNamespace(association, namespaces);
            var type = FindType(ns, association);

            var customAttributes = association.Property.GetCustomAttributes(false).ToList();
            var attributes = customAttributes.Cast<Attribute>().ToList();

            var propertyReturnType =
                DeclaredType.Unresolved(Identifier.FromType(association.Property.PropertyType),
                                        association.Property.PropertyType,
                                        Namespace.Unresolved(
                                            Identifier.FromNamespace(association.Property.PropertyType.Namespace)));
            var doc = Property.Unresolved(Identifier.FromProperty(association.Property, association.TargetType), type, propertyReturnType, attributes);

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

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

            matchedAssociations.Add(association.Name, doc);
            if (type == null) return;
            type.AddProperty(doc);
        }
示例#2
0
        public void Add( List<Namespace> namespaces, DocumentedProperty association )
        {
            try
            {
                if( association.Property == null ) return;

                var ns = FindNamespace( association, namespaces );
                var type = FindType( ns, association );

                var propertyReturnType =
                    DeclaredType.Unresolved( Identifier.FromType( association.Property.PropertyType ),
                                            association.Property.PropertyType,
                                            Namespace.Unresolved(
                                                Identifier.FromNamespace( association.Property.PropertyType.Namespace ) ) );
                var doc = Property.Unresolved( Identifier.FromProperty( association.Property, association.TargetType ), type, propertyReturnType );

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

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

                matchedAssociations.Add( association.Name, doc );
                if( type == null ) return;
                type.AddProperty( doc );
            }
            catch( Exception ) { }
        }
示例#3
0
        static void MatchProperty(List<IDocumentationMember> members, XmlNode node)
        {
            Identifier member = IdentifierFor.XmlString(node.Attributes["name"].Value);

            for (int i = 0; i < members.Count; i++)
            {
                var reflected = members[i] as ReflectedProperty;
                if (reflected != null && reflected.Match(member))
                    members[i] = new DocumentedProperty(reflected.Name, node, reflected.Property, reflected.TargetType);
            }
        }
        private void ParseProperty(List<IDocumentationMember> members, XmlNode node)
        {
            Identifier member = Identifier.FromString(node.Attributes["name"].Value);

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

                if (propertyMember != null && propertyMember.Match(member))
                    members[i] = new DocumentedProperty(member, node, propertyMember.Property, propertyMember.TargetType);
            }
        }
示例#5
0
        public void Add(List<Namespace> namespaces, DocumentedProperty association)
        {
            if (association.Property == null)
            {
                return;
            }

            Namespace ns = this.FindNamespace(association, namespaces);
            DeclaredType type = this.FindType(ns, association);

            DeclaredType propertyReturnType =
                DeclaredType.Unresolved(
                    Identifier.FromType(association.Property.PropertyType),
                    association.Property.PropertyType,
                    Namespace.Unresolved(Identifier.FromNamespace(association.Property.PropertyType.Namespace)));
            Property doc = Property.Unresolved(
                Identifier.FromProperty(association.Property, association.TargetType), type, propertyReturnType);

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

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

            this.matchedAssociations.Add(association.Name, doc);
            if (type == null)
            {
                return;
            }

            type.AddProperty(doc);
        }
示例#6
0
        private void AddProperty(List<Namespace> namespaces, List<IReferencable> references, DocumentedProperty association)
        {
            if (association.Property == null) return;

            NamespaceIdentifier namespaceName = Identifier.FromNamespace(association.TargetType.Namespace);
            TypeIdentifier typeName = Identifier.FromType(association.TargetType);
            Namespace @namespace = namespaces.Find(x => x.IsIdentifiedBy(namespaceName));

            if (@namespace == null)
            {
                AddNamespace(namespaces, new DocumentedType(association.Name.CloneAsNamespace(), null, association.TargetType));
                @namespace = namespaces.Find(x => x.IsIdentifiedBy(namespaceName));
            }

            DeclaredType type = @namespace.Types.FirstOrDefault(x => x.IsIdentifiedBy(typeName));

            if (type == null)
            {
                AddType(namespaces, references,
                        new DocumentedType(association.Name.CloneAsType(), null, association.TargetType));
                type = @namespace.Types.FirstOrDefault(x => x.IsIdentifiedBy(typeName));
            }

            DeclaredType propertyReturnType =
                DeclaredType.Unresolved(Identifier.FromType(association.Property.PropertyType),
                                        association.Property.PropertyType,
                                        Namespace.Unresolved(
                                            Identifier.FromNamespace(association.Property.PropertyType.Namespace)));
            Property doc = Property.Unresolved(Identifier.FromProperty(association.Property, association.TargetType),
                                               propertyReturnType);

            references.Add(propertyReturnType);

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

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

                GetReferencesFromComment(references, doc.Summary);
            }

            references.Add(doc);
            type.AddProperty(doc);
        }