Example #1
0
        private void GenerateNamespaceTopic(Topic topic)
        {
            var contentFinder = new NamespaceContentFinder(_context.SchemaSetManager, topic.Namespace);

            contentFinder.Traverse(_context.SchemaSetManager.SchemaSet);

            using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    writer.StartTopic(topic.Id);
                    writer.WriteIntroductionForNamespace(_context, topic.Namespace);
                    writer.WriteRemarksSectionForNamespace(_context, topic.Namespace);
                    writer.WriteExamplesSectionForNamespace(_context, topic.Namespace);
                    writer.WriteRootSchemasSection(_context, _context.SchemaSetManager.GetNamespaceRootSchemas(topic.Namespace));
                    writer.WriteRootElementsSection(_context, _context.SchemaSetManager.GetNamespaceRootElements(topic.Namespace));
                    writer.WriteSchemasSection(_context, contentFinder.Schemas);
                    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();
                }
        }
Example #2
0
        private void GenerateOverviewTopic(Topic topic)
        {
            var contentFinder = new NamespaceContentFinder(_context.SchemaSetManager, topic.Namespace);

            contentFinder.Traverse(_context.SchemaSetManager.SchemaSet);

            using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    writer.StartTopic(topic.Id);
                    writer.WriteIntroductionForOverview(_context, topic.Namespace);

                    switch (topic.TopicType)
                    {
                    case TopicType.RootSchemasSection:
                        writer.WriteRootSchemasSection(_context, _context.SchemaSetManager.GetNamespaceRootSchemas(topic.Namespace));
                        break;

                    case TopicType.RootElementsSection:
                        writer.WriteRootElementsSection(_context, _context.SchemaSetManager.GetNamespaceRootElements(topic.Namespace));
                        break;

                    case TopicType.SchemasSection:
                        writer.WriteSchemasSection(_context, contentFinder.Schemas);
                        break;

                    case TopicType.ElementsSection:
                        writer.WriteElementsSection(_context, contentFinder.Elements);
                        break;

                    case TopicType.AttributesSection:
                        writer.WriteAttributesSection(_context, contentFinder.Attributes);
                        break;

                    case TopicType.AttributeGroupsSection:
                        writer.WriteAttributeGroupsSection(_context, contentFinder.AttributeGroups);
                        break;

                    case TopicType.GroupsSection:
                        writer.WriteGroupsSection(_context, contentFinder.Groups);
                        break;

                    case TopicType.SimpleTypesSection:
                        writer.WriteSimpleTypesSection(_context, contentFinder.SimpleTypes);
                        break;

                    case TopicType.ComplexTypesSection:
                        writer.WriteComplexTypesSection(_context, contentFinder.ComplexTypes);
                        break;

                    default:
                        throw ExceptionBuilder.UnhandledCaseLabel(topic.TopicType);
                    }

                    writer.EndTopic();
                }
        }
Example #3
0
        private void GenerateNamespaceTopic(Topic topic)
        {
            var contentFinder = new NamespaceContentFinder(_context.SchemaSetManager, topic.Namespace);

            contentFinder.Traverse(_context.SchemaSetManager.SchemaSet);

            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.WriteIntroductionForNamespace(_context, topic.Namespace);
                    writer.WriteRemarksSectionForNamespace(_context, topic.Namespace);
                    writer.WriteExamplesSectionForNamespace(_context, topic.Namespace);
                    writer.WriteRootSchemasSection(_context, _context.SchemaSetManager.GetNamespaceRootSchemas(topic.Namespace));
                    writer.WriteRootElementsSection(_context, _context.SchemaSetManager.GetNamespaceRootElements(topic.Namespace));
                    writer.WriteSchemasSection(_context, contentFinder.Schemas);
                    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();
                    }
                }
        }
        private void GenerateSchemaSetTopic(Topic topic)
        {
            if (_context.Configuration.NamespaceContainer)
            {
                using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    writer.StartTopic(topic.Id);
                    writer.WriteIntroductionForSchemaSet(_context);
                    writer.WriteRemarksSectionForSchemaSet(_context);
                    writer.WriteExamplesSectionForSchemaSet(_context);
                    writer.WriteNamespacesSection(_context, _context.SchemaSetManager.GetNamespaces());
                    writer.EndTopic();
                }
            }
            else
            {
                var contentFinder = new NamespaceContentFinder(_context.SchemaSetManager, topic.Namespace);
                contentFinder.Traverse(_context.SchemaSetManager.SchemaSet);

                using (var stream = File.Create(topic.FileName))
                using (var writer = new MamlWriter(stream))
                {
                    writer.StartTopic(topic.Id);
                    writer.WriteIntroductionForSchemaSet(_context);
                    writer.WriteRemarksSectionForSchemaSet(_context);
                    writer.WriteExamplesSectionForSchemaSet(_context);
                    writer.WriteRootSchemasSection(_context, _context.SchemaSetManager.GetNamespaceRootSchemas(topic.Namespace));
                    writer.WriteRootElementsSection(_context, _context.SchemaSetManager.GetNamespaceRootElements(topic.Namespace));
                    writer.WriteSchemasSection(_context, contentFinder.Schemas);
                    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();
                }
            }
        }
        private void GenerateOverviewTopic(Topic topic)
        {
            var contentFinder = new NamespaceContentFinder(_context.SchemaSetManager, topic.Namespace);
            contentFinder.Traverse(_context.SchemaSetManager.SchemaSet);

            using (var stream = File.Create(topic.FileName))
            using (var writer = new MamlWriter(stream))
            {
                writer.StartTopic(topic.Id);
                writer.WriteIntroductionForOverview(_context, topic.Namespace);

                switch (topic.TopicType)
                {
                    case TopicType.RootSchemasSection:
                        writer.WriteRootSchemasSection(_context, _context.SchemaSetManager.GetNamespaceRootSchemas(topic.Namespace));
                        break;
                    case TopicType.RootElementsSection:
                        writer.WriteRootElementsSection(_context, _context.SchemaSetManager.GetNamespaceRootElements(topic.Namespace));
                        break;
                    case TopicType.SchemasSection:
                        writer.WriteSchemasSection(_context, contentFinder.Schemas);
                        break;
                    case TopicType.ElementsSection:
                        writer.WriteElementsSection(_context, contentFinder.Elements);
                        break;
                    case TopicType.AttributesSection:
                        writer.WriteAttributesSection(_context, contentFinder.Attributes);
                        break;
                    case TopicType.AttributeGroupsSection:
                        writer.WriteAttributeGroupsSection(_context, contentFinder.AttributeGroups);
                        break;
                    case TopicType.GroupsSection:
                        writer.WriteGroupsSection(_context, contentFinder.Groups);
                        break;
                    case TopicType.SimpleTypesSection:
                        writer.WriteSimpleTypesSection(_context, contentFinder.SimpleTypes);
                        break;
                    case TopicType.ComplexTypesSection:
                        writer.WriteComplexTypesSection(_context, contentFinder.ComplexTypes);
                        break;
                    default:
                        throw ExceptionBuilder.UnhandledCaseLabel(topic.TopicType);
                }

                writer.EndTopic();
            }
        }