Exemplo n.º 1
0
        private void GenerateElementTopic(Topic topic)
        {
            var element = (XmlSchemaElement)topic.SchemaObject;
            var parents = _context.SchemaSetManager.GetObjectParents(element);
            var simpleTypeStructureRoot = _context.SchemaSetManager.GetSimpleTypeStructure(element.ElementSchemaType);
            var children = _context.SchemaSetManager.GetChildren(element);
            var attributeEntries = _context.SchemaSetManager.GetAttributeEntries(element);
            var constraints = element.Constraints;

            using (var stream = File.Create(topic.FileName))
            using (var writer = new MamlWriter(stream))
            {
                writer.StartTopic(topic.Id);
                writer.WriteIntroductionForObject(_context, element);
                writer.WriteTypeSection(_context, element);
                writer.WriteContentTypeSection(_context, simpleTypeStructureRoot);
                writer.WriteParentsSection(_context, parents);
                writer.WriteChildrenSection(_context, children);
                writer.WriteAttributesSection(_context, attributeEntries);
                writer.WriteConstraintsSection(_context, constraints);
                writer.WriteRemarksSectionForObject(_context, element);
                writer.WriteExamplesSectionForObject(_context, element);
                writer.WriteSyntaxSection(_context, element);
                writer.WriteRelatedTopics(_context, element);
                writer.EndTopic();
            }
        }
Exemplo n.º 2
0
        private void GenerateGroupTopic(Topic topic)
        {
            var group = (XmlSchemaGroup)topic.SchemaObject;
            var parents = _context.SchemaSetManager.GetObjectParents(group);
            var children = _context.SchemaSetManager.GetChildren(group);

            using (var stream = File.Create(topic.FileName))
            using (var writer = new MamlWriter(stream))
            {
                writer.StartTopic(topic.Id);
                writer.WriteIntroductionForObject(_context, group);
                writer.WriteUsagesSection(_context, parents);
                writer.WriteChildrenSection(_context, children);
                writer.WriteRemarksSectionForObject(_context, group);
                writer.WriteExamplesSectionForObject(_context, group);
                writer.WriteSyntaxSection(_context, group);
                writer.WriteRelatedTopics(_context, group);
                writer.EndTopic();
            }
        }
Exemplo n.º 3
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();
            }
        }