Example #1
0
        internal static string GenerateCode(string[] DocXsds, string DocTypeName, string DocRev, params string[] AdditionalRootNames)
        {
            string cSharpNameSpace = RuntimeTypeNamer.CalcCSharpFullname(DocTypeName, DocRev, AdditionalRootNames);
            string myclasses_cs    = new Xsd().ImportSchemasAsClasses(
                DocXsds,
                cSharpNameSpace,
                CodeGenerationOptions.GenerateOrder | CodeGenerationOptions.GenerateProperties,
                new StringCollection());

            return(CustomizeXsdToCSharpOutput(DocTypeName, myclasses_cs));
        }
Example #2
0
        public static BaseDoc ActivateBaseDoc(string DocTypeName, string DocRev, params string[] AdditionalRootNames)
        {
            string key = RuntimeTypeNamer.CalcCSharpFullname(DocTypeName, DocRev, AdditionalRootNames);

            return(_CompileBaseDoc_Dictionary.ContainsKey(key)
                        ? _CompileBaseDoc_Dictionary[key]
                        : _CompileBaseDoc_Dictionary[key] = FindBaseDoc(
                       MakeBaseDocAssembly(
                           new[] { TemplateController.Instance.OpenText(DocTypeName, DocRev, "myschema.xsd") },
                           DocTypeName,
                           DocRev,
                           AdditionalRootNames), DocTypeName));
        }
Example #3
0
 /// <summary>
 ///     Utilizes .Net API that drives XSD.EXE to auto-gen cSharp code that is further modified to suite this solution &
 ///     finally runtime compiled to yield another BaseDoc. Unix guys might think of this as a SED script.
 /// </summary>
 /// <param name="DocXsd"></param>
 /// <param name="DocTypeName"></param>
 /// <param name="DocRev"></param>
 /// <param name="cSharpNameSpace"></param>
 /// <returns></returns>
 internal static Assembly MakeBaseDocAssembly(string[] DocXsds, string DocTypeName, string DocRev, params string[] AdditionalRootNames)
 {
     //   model entities from any other assemblies loaded into memory
     // As of Tue 12/16/2014, *.xsn files transformed (by T4) to POCO
     // objects took place in a separate VS Solution -> Project then
     // this (Core/dCForm.dll). The solution output had a
     // WebSite project that brought both the assemblies together
     // as the end product
     return(CompileCSharpCode(
                GenerateCode(
                    DocXsds,
                    DocTypeName,
                    DocRev,
                    AdditionalRootNames),
                RuntimeTypeNamer.CalcCSharpFullname(
                    DocTypeName,
                    DocRev,
                    AdditionalRootNames)));
 }