当前位置: 首页>>代码示例>>C#>>正文


C# DocProject.BuildXsdFormatList方法代码示例

本文整理汇总了C#中DocProject.BuildXsdFormatList方法的典型用法代码示例。如果您正苦于以下问题:C# DocProject.BuildXsdFormatList方法的具体用法?C# DocProject.BuildXsdFormatList怎么用?C# DocProject.BuildXsdFormatList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocProject的用法示例。


在下文中一共展示了DocProject.BuildXsdFormatList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GeneratePublication

        public static void GeneratePublication(
            DocProject docProject, 
            string path,
            Dictionary<long, SEntity> instances,
            Dictionary<string, DocObject> mapEntity, 
            Dictionary<string, string> mapSchema, 
            DocPublication docPublication,
            BackgroundWorker worker, 
            FormProgress formProgress)
        {
            instances.Clear(); // clear out old state from mvdxml export
            docPublication.ErrorLog.Clear();

            DiagramFormat diagramformat = DiagramFormat.ExpressG;
            if(docPublication.UML)
            {
                diagramformat = DiagramFormat.UML;
            }

            DocModelView[] views = docPublication.Views.ToArray();
            string[] locales = docPublication.Locales.ToArray();

            List<DocXsdFormat> xsdFormatBase = docProject.BuildXsdFormatList();
            string xmlns = "http://www.buildingsmart-tech.org/ifcXML/IFC4/final";

            // for now these are paired; in future they may be split
            Dictionary<DocFormatSchemaEnum, IFormatExtension> mapFormatSchema = new Dictionary<DocFormatSchemaEnum, IFormatExtension>();
            Dictionary<DocFormatSchemaEnum, IFormatData> mapFormatData = new Dictionary<DocFormatSchemaEnum, IFormatData>();
            foreach (DocFormat docFormat in docPublication.Formats)
            {
                switch(docFormat.FormatType)
                {
                    case DocFormatSchemaEnum.TTL:
                        mapFormatSchema.Add(docFormat.FormatType, new FormatOWL());
                        mapFormatData.Add(docFormat.FormatType, new FormatOWL());
                        break;

                    case DocFormatSchemaEnum.SQL:
                        mapFormatSchema.Add(docFormat.FormatType, new FormatSQL());
                        mapFormatData.Add(docFormat.FormatType, new FormatSQL());
                        break;

                    case DocFormatSchemaEnum.CS:
                        mapFormatSchema.Add(docFormat.FormatType, new FormatCSC());
                        break;

                    case DocFormatSchemaEnum.JSON:
                        mapFormatSchema.Add(docFormat.FormatType, new FormatJAV());
                        mapFormatData.Add(docFormat.FormatType, new FormatJSN(xsdFormatBase, xmlns, docPublication.Code));
                        break;

                    case DocFormatSchemaEnum.XML:
                        mapFormatSchema.Add(docFormat.FormatType, new FormatXSD(null));
                        mapFormatData.Add(docFormat.FormatType, new FormatSML(new System.IO.MemoryStream(), xsdFormatBase, xmlns, docPublication.Code));
                        break;

                }
            }

            // copy over static content * if it doesn't already exist *
            string pathContent = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            if (pathContent.EndsWith(@"bin\x86\Debug") || pathContent.EndsWith(@"bin\x64\Debug")) // debugging
            {
                pathContent = System.IO.Path.GetDirectoryName(pathContent);
                pathContent = System.IO.Path.GetDirectoryName(pathContent);
                pathContent = System.IO.Path.GetDirectoryName(pathContent);
            }
            pathContent = System.IO.Path.Combine(pathContent, "content");

            if(!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }

            CopyFiles(pathContent, path);

            System.IO.Directory.CreateDirectory(path + "\\diagrams");

            Dictionary<string, DocPropertyEnumeration> mapPropEnum = new Dictionary<string, DocPropertyEnumeration>();
            foreach (DocSection docSection in docProject.Sections)
            {
                foreach (DocSchema docSchema in docSection.Schemas)
                {
                    foreach (DocPropertyEnumeration docEnum in docSchema.PropertyEnums)
                    {
                        mapPropEnum.Add(docEnum.Name, docEnum);
                    }
                }
            }

            Dictionary<DocObject, string> mapNumber = new Dictionary<DocObject, string>(); // map items to section (e.g. "1.1.1.1")

            string pathSchema = path + @"\schema";

            // count progress
            int progressTotal = docProject.Sections.Count + docProject.Annexes.Count + 2;
            formProgress.SetProgressTotal(progressTotal);
            worker.ReportProgress(0, "================================================================================");
            worker.ReportProgress(0, docPublication);

//.........这里部分代码省略.........
开发者ID:pipauwel,项目名称:IfcDoc,代码行数:101,代码来源:DocumentationISO.cs


注:本文中的DocProject.BuildXsdFormatList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。