コード例 #1
0
        public static IConstraintGenerator NewConstraintGenerator(
            IGSettingsManager igSettings,
            Body documentBody,
            CommentManager cmtMgr,
            FigureCollection figures,
            WIKIParser wikiParser,
            bool includeSamples,
            IObjectRepository dataSource,
            List <TemplateConstraint> rootConstraints,
            List <TemplateConstraint> allConstraints,
            Template currentTemplate,
            List <Template> allTemplates,
            string constraintHeadingStyle,
            List <string> selectedCategories)
        {
            IConstraintGenerator constraintGenerator = null;

            if (igSettings.GetBoolSetting(IGSettingsManager.SettingProperty.UseConsolidatedConstraintFormat))
            {
                constraintGenerator = new ConsolidatedGeneration();
            }
            else
            {
                constraintGenerator = new LegacyGeneration();
            }

            constraintGenerator.IGSettings             = igSettings;
            constraintGenerator.DocumentBody           = documentBody;
            constraintGenerator.Figures                = figures;
            constraintGenerator.WikiParser             = wikiParser;
            constraintGenerator.IncludeSamples         = includeSamples;
            constraintGenerator.DataSource             = dataSource;
            constraintGenerator.RootConstraints        = rootConstraints;
            constraintGenerator.AllConstraints         = allConstraints;
            constraintGenerator.CurrentTemplate        = currentTemplate;
            constraintGenerator.AllTemplates           = allTemplates;
            constraintGenerator.ConstraintHeadingStyle = constraintHeadingStyle;
            constraintGenerator.CommentManager         = cmtMgr;
            constraintGenerator.IncludeCategory        = !string.IsNullOrEmpty(igSettings.GetSetting(IGSettingsManager.SettingProperty.Categories));
            constraintGenerator.SelectedCategories     = selectedCategories;

            return(constraintGenerator);
        }
コード例 #2
0
        public void BuildImplementationGuide(ExportSettings aModel)
        {
            this._exportSettings = aModel;

            this._docStream = new MemoryStream();
            this._document  = WordprocessingDocument.Create(this._docStream, WordprocessingDocumentType.Document);
            this._document.AddMainDocumentPart();

            this.SetupStyles();

            this._document.MainDocumentPart.Document =
                new Document(
                    new Body());

            this.tables = new TableCollection(this._document.MainDocumentPart.Document.Body);
            this.constraintTableGenerator = new TemplateConstraintTable(this._settings, this._templates, this.tables, _exportSettings.SelectedCategories);
            this.figures = new FigureCollection(this._document.MainDocumentPart.Document.Body);
            this.valueSetsExport
                = new ValueSetsExport(
                      this._document.MainDocumentPart,
                      this.tables,
                      _exportSettings.GenerateValueSetAppendix,
                      _exportSettings.DefaultValueSetMaxMembers,
                      _exportSettings.ValueSetMaxMembers);
            this.wikiParser      = new WIKIParser(this._tdb, this._document.MainDocumentPart);
            this.codeSystemTable = new CodeSystemTable(this._tdb, this._document.MainDocumentPart.Document.Body, this._templates, this.tables);

            this.AddTitlePage();

            this.AddTableOfContents();

            this.AddTemplates();

            if (_exportSettings.GenerateDocTemplateListTable || _exportSettings.GenerateDocContainmentTable)
            {
                Paragraph entryLevelHeading = new Paragraph(
                    new ParagraphProperties(
                        new ParagraphStyleId()
                {
                    Val = Properties.Settings.Default.TemplateTypeHeadingStyle
                }),
                    new Run(
                        new Text("Template Ids in This Guide")));
                this._document.MainDocumentPart.Document.Body.AppendChild(entryLevelHeading);

                if (_exportSettings.GenerateDocTemplateListTable)
                {
                    // Add used template table
                    this.AddDocumentTemplateListTable();
                }

                if (_exportSettings.GenerateDocContainmentTable)
                {
                    TemplateContainmentGenerator.AddTable(this._tdb, this._document, this._templates, this.tables);
                }
            }

            this.valueSetsExport.AddValueSetsAppendix();

            this.codeSystemTable.AddCodeSystemAppendix();

            this.AddRetiredTemplatesAppendix();

            if (_exportSettings.IncludeChangeList)
            {
                this.LoadChangesAppendix();
            }
        }