Exemplo n.º 1
0
        private void GenerateSchemaTopic(Topic topic)
        {
            var schema = (XmlSchema)topic.SchemaObject;

            var contentFinder = new SchemaContentFinder(schema);

            contentFinder.Traverse(schema);

            using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    if (_includeTopicTag)
                    {
                        writer.StartTopic(topic.Id);
                    }
                    else
                    {
                        writer.StartDocument();
                    }

                    if (_configuration.IncludeMoveToTop)
                    {
                        _context.MoveToTopLink = true;
                    }

                    writer.WriteIntroductionForSchema(_context, schema);
                    writer.WriteRemarksSectionForObject(_context, schema);
                    writer.WriteExamplesSectionForObject(_context, schema);
                    writer.WriteElementsSection(_context, contentFinder.Elements);
                    writer.WriteAttributesSection(_context, contentFinder.Attributes);
                    writer.WriteGroupsSection(_context, contentFinder.Groups);
                    writer.WriteAttributeGroupsSection(_context, contentFinder.AttributeGroups);
                    writer.WriteSimpleTypesSection(_context, contentFinder.SimpleTypes);
                    writer.WriteComplexTypesSection(_context, contentFinder.ComplexTypes);

                    _context.MoveToTopLink = false;

                    if (_includeTopicTag)
                    {
                        writer.EndTopic();
                    }
                    else
                    {
                        writer.EndDocument();
                    }
                }
        }
Exemplo n.º 2
0
        private void GenerateSchemaTopic(Topic topic)
        {
            var schema = (XmlSchema)topic.SchemaObject;

            var contentFinder = new SchemaContentFinder(schema);

            contentFinder.Traverse(schema);

            using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    writer.StartTopic(topic.Id);
                    writer.WriteIntroductionForSchema(_context, schema);
                    writer.WriteRemarksSectionForObject(_context, schema);
                    writer.WriteExamplesSectionForObject(_context, schema);
                    writer.WriteElementsSection(_context, contentFinder.Elements);
                    writer.WriteAttributesSection(_context, contentFinder.Attributes);
                    writer.WriteGroupsSection(_context, contentFinder.Groups);
                    writer.WriteAttributeGroupsSection(_context, contentFinder.AttributeGroups);
                    writer.WriteSimpleTypesSection(_context, contentFinder.SimpleTypes);
                    writer.WriteComplexTypesSection(_context, contentFinder.ComplexTypes);
                    writer.EndTopic();
                }
        }
Exemplo n.º 3
0
        private void GenerateSchemaTopic(Topic topic)
        {
            var schema = (XmlSchema)topic.SchemaObject;

            var contentFinder = new SchemaContentFinder(schema);
            contentFinder.Traverse(schema);

            using (var stream = File.Create(topic.FileName))
            using (var writer = new MamlWriter(stream))
            {
                writer.StartTopic(topic.Id);
                writer.WriteIntroductionForSchema(_context, schema);
                writer.WriteRemarksSectionForObject(_context, schema);
                writer.WriteExamplesSectionForObject(_context, schema);
                writer.WriteElementsSection(_context, contentFinder.Elements);
                writer.WriteAttributesSection(_context, contentFinder.Attributes);
                writer.WriteGroupsSection(_context, contentFinder.Groups);
                writer.WriteAttributeGroupsSection(_context, contentFinder.AttributeGroups);
                writer.WriteSimpleTypesSection(_context, contentFinder.SimpleTypes);
                writer.WriteComplexTypesSection(_context, contentFinder.ComplexTypes);
                writer.EndTopic();
            }
        }