예제 #1
0
        public XsdConfigurationForm(XsdPlugInConfiguration configuration)
        {
            InitializeComponent();

            NewConfiguration = configuration.Clone();
            HelpKeyword      = HelpTopics.ConfigurePlugIn;

            _propertyGrid.SelectedObject = NewConfiguration;
        }
예제 #2
0
        /// <summary>
        /// This method is used by the Sandcastle Help File Builder to let the
        /// plug-in perform its own configuration.
        /// </summary>
        /// <param name="project">A reference to the active project</param>
        /// <param name="currentConfig">The current configuration XML fragment</param>
        /// <returns>A string containing the new configuration XML fragment</returns>
        /// <remarks>The configuration data will be stored in the help file
        /// builder project.</remarks>
        public string ConfigurePlugIn(SandcastleProject project, string currentConfig)
        {
            var configuration = XsdPlugInConfiguration.FromXml(project, currentConfig);

            using (var dlg = new XsdConfigurationForm(configuration))
            {
                return((dlg.ShowDialog() == DialogResult.OK)
                        ? XsdPlugInConfiguration.ToXml(dlg.NewConfiguration)
                        : currentConfig);
            }
        }
예제 #3
0
 private XsdPlugInConfiguration(XsdPlugInConfiguration other)
 {
     BasePathProvider     = other.BasePathProvider;
     DocumentRootSchemas  = other.DocumentRootSchemas;
     DocumentRootElements = other.DocumentRootElements;
     DocumentConstraints  = other.DocumentConstraints;
     DocumentSchemas      = other.DocumentSchemas;
     DocumentSyntax       = other.DocumentSyntax;
     UseTypeDocumentationForUndocumentedAttributes = other.UseTypeDocumentationForUndocumentedAttributes;
     UseTypeDocumentationForUndocumentedElements   = other.UseTypeDocumentationForUndocumentedElements;
     SchemaSetContainer          = other.SchemaSetContainer;
     SchemaSetTitle              = other.SchemaSetTitle;
     NamespaceContainer          = other.NamespaceContainer;
     SortOrder                   = other.SortOrder;
     IncludeLinkUriInKeywordK    = other.IncludeLinkUriInKeywordK;
     AnnotationTransformFilePath = (FilePath)other.AnnotationTransformFilePath.Clone();
     SchemaFilePaths             = other.SchemaFilePaths.Clone();
     SchemaDependencyFilePaths   = other.SchemaDependencyFilePaths.Clone();
     DocFilePaths                = other.DocFilePaths.Clone();
 }
예제 #4
0
 /// <summary>
 /// This method is used to initialize the plug-in at the start of the
 /// build process.
 /// </summary>
 /// <param name="buildProcess">A reference to the current build
 /// process.</param>
 /// <param name="configuration">The configuration data that the plug-in
 /// should use to initialize itself.</param>
 public void Initialize(BuildProcess buildProcess, XPathNavigator configuration)
 {
     _configuration = XsdPlugInConfiguration.FromXml(buildProcess.CurrentProject, configuration);
     _buildProcess  = buildProcess;
     _buildProcess.ReportProgress(Resources.PlugInVersionFormatted, Resources.PlugInName, XsdDocMetadata.Version, XsdDocMetadata.Copyright);
 }
예제 #5
0
        public static string ToXml(XsdPlugInConfiguration configuration)
        {
            var doc = new XmlDocument();
            var configurationNode = doc.CreateElement("configuration");

            doc.AppendChild(configurationNode);

            var documentNode = doc.CreateElement("document");

            documentNode.SetAttribute("rootSchemas", XmlConvert.ToString(configuration.DocumentRootSchemas));
            documentNode.SetAttribute("rootElements", XmlConvert.ToString(configuration.DocumentRootElements));
            documentNode.SetAttribute("constraints", XmlConvert.ToString(configuration.DocumentConstraints));
            documentNode.SetAttribute("schemas", XmlConvert.ToString(configuration.DocumentSchemas));
            documentNode.SetAttribute("syntax", XmlConvert.ToString(configuration.DocumentSyntax));
            configurationNode.AppendChild(documentNode);

            var useTypeDocumentationNode = doc.CreateElement("useTypeDocumentation");

            useTypeDocumentationNode.SetAttribute("forUndocumentedAttributes", XmlConvert.ToString(configuration.UseTypeDocumentationForUndocumentedAttributes));
            useTypeDocumentationNode.SetAttribute("forUndocumentedElements", XmlConvert.ToString(configuration.UseTypeDocumentationForUndocumentedElements));
            configurationNode.AppendChild(useTypeDocumentationNode);

            var schemaSetNode = doc.CreateElement("schemaSet");

            schemaSetNode.SetAttribute("container", XmlConvert.ToString(configuration.SchemaSetContainer));
            schemaSetNode.SetAttribute("title", configuration.SchemaSetTitle);
            configurationNode.AppendChild(schemaSetNode);

            var namespaceNode = doc.CreateElement("namespace");

            namespaceNode.SetAttribute("container", XmlConvert.ToString(configuration.NamespaceContainer));
            configurationNode.AppendChild(namespaceNode);

            var sortOrderNode = doc.CreateElement("sortOrder");

            sortOrderNode.InnerText = XmlConvert.ToString(configuration.SortOrder);
            configurationNode.AppendChild(sortOrderNode);

            var includeLinkUriInKeywordKNode = doc.CreateElement("includeLinkUriInKeywordK");

            includeLinkUriInKeywordKNode.InnerText = XmlConvert.ToString(configuration.IncludeLinkUriInKeywordK);
            configurationNode.AppendChild(includeLinkUriInKeywordKNode);

            var annotationTransformFileNode = doc.CreateElement("annotationTransformFile");

            annotationTransformFileNode.SetAttribute("path", configuration.AnnotationTransformFilePath.PersistablePath);
            configurationNode.AppendChild(annotationTransformFileNode);

            var schemaFilesNode = doc.CreateElement("schemaFiles");

            configurationNode.AppendChild(schemaFilesNode);

            foreach (var filePath in configuration.SchemaFilePaths)
            {
                var schemaFileNode = doc.CreateElement("schemaFile");
                schemaFileNode.SetAttribute("path", filePath.PersistablePath);
                schemaFilesNode.AppendChild(schemaFileNode);
            }

            var dependencyFilesNode = doc.CreateElement("dependencyFiles");

            configurationNode.AppendChild(dependencyFilesNode);

            foreach (var filePath in configuration.SchemaDependencyFilePaths)
            {
                var schemaFileNode = doc.CreateElement("schemaFile");
                schemaFileNode.SetAttribute("path", filePath.PersistablePath);
                dependencyFilesNode.AppendChild(schemaFileNode);
            }

            var docFilesNode = doc.CreateElement("docFiles");

            configurationNode.AppendChild(docFilesNode);

            foreach (var filePath in configuration.DocFilePaths)
            {
                var docFileNode = doc.CreateElement("docFile");
                docFileNode.SetAttribute("path", filePath.PersistablePath);
                docFilesNode.AppendChild(docFileNode);
            }

            return(doc.OuterXml);
        }