Exemplo n.º 1
0
        private void GenerateComplexTypeTopic(Topic topic)
        {
            var complexType             = (XmlSchemaComplexType)topic.SchemaObject;
            var usages                  = _context.SchemaSetManager.GetTypeUsages(complexType);
            var simpleTypeStructureRoot = _context.SchemaSetManager.GetSimpleTypeStructure(complexType);
            var children                = _context.SchemaSetManager.GetChildren(complexType);
            var attributeEntries        = _context.SchemaSetManager.GetAttributeEntries(complexType);

            using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    writer.StartTopic(topic.Id);
                    writer.WriteIntroductionForObject(_context, complexType);
                    writer.WriteBaseTypeSection(_context, complexType);
                    writer.WriteContentTypeSection(_context, simpleTypeStructureRoot);
                    writer.WriteUsagesSection(_context, usages);
                    writer.WriteChildrenSection(_context, children);
                    writer.WriteAttributesSection(_context, attributeEntries);
                    writer.WriteRemarksSectionForObject(_context, complexType);
                    writer.WriteExamplesSectionForObject(_context, complexType);
                    writer.WriteSyntaxSection(_context, complexType);
                    writer.WriteRelatedTopics(_context, complexType);
                    writer.EndTopic();
                }
        }