public CodeNamespaceCollection Build()
        {
            var TibcoXslHelperNameSpace = new CodeNamespace(TargetAppNameSpaceService.xmlToolsNameSpace());

            // Generate the Service
            TibcoXslHelperNameSpace.Imports.AddRange(this.GenerateImports());
            var TibcoXslHelperClass = this.GenerateClass();

            TibcoXslHelperNameSpace.Types.Add(TibcoXslHelperClass);

            return(new CodeNamespaceCollection {
                TibcoXslHelperNameSpace
            });
        }
        private CodeNamespaceImport[] GenerateImports()
        {
            var imports = new List <CodeNamespaceImport>
            {
                new CodeNamespaceImport("System"),
                new CodeNamespaceImport(TargetAppNameSpaceService.domainContractNamespaceName()),
                new CodeNamespaceImport(TargetAppNameSpaceService.dataAccessNamespace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.domainServiceNamespaceName()),
                new CodeNamespaceImport(TargetAppNameSpaceService.EngineCommandNamespace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.dataAccessNamespace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.EventSourcingNameSpace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.loggerNameSpace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.xmlToolsNameSpace())
            };

            return(imports.ToArray());
        }
        public CodeNamespaceCollection Build()
        {
            var xmlParserHelperNameSpace = new CodeNamespace(TargetAppNameSpaceService.xmlToolsNameSpace());

            // Generate the Service
            xmlParserHelperNameSpace.Imports.AddRange(this.GenerateImports());
            var xmlParserHelperService = this.GenerateClass();

            xmlParserHelperNameSpace.Types.Add(xmlParserHelperService);

            // Generate the corresponding interface
            var xmlParserHelperServiceInterfaceNameSpace = InterfaceExtractorFromClass.Extract(xmlParserHelperService, TargetAppNameSpaceService.xmlToolsNameSpace());

            ModuleBuilder.AddServiceToRegister(IXmlParserHelperServiceName, XmlParserHelperServiceName);
            return(new CodeNamespaceCollection {
                xmlParserHelperNameSpace, xmlParserHelperServiceInterfaceNameSpace
            });
        }
        /// <summary>
        /// Generates the import.
        /// </summary>
        /// <returns>The import.</returns>
        /// <param name="tibcoBwProcessToGenerate">Tibco bw process to generate.</param>
        public CodeNamespaceImport[] GenerateImport(TibcoBWProcess tibcoBwProcessToGenerate)
        {
            var imports = new List <CodeNamespaceImport>
            {
                new CodeNamespaceImport("System"),
                new CodeNamespaceImport(TargetAppNameSpaceService.xmlToolsNameSpace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.loggerNameSpace())
            };

            if ((tibcoBwProcessToGenerate.StartActivity != null && tibcoBwProcessToGenerate.StartActivity.Parameters != null) ||
                (tibcoBwProcessToGenerate.EndActivity != null && tibcoBwProcessToGenerate.EndActivity.Parameters != null))
            {
                imports.Add(new CodeNamespaceImport(TargetAppNameSpaceService.myAppName() + "." + tibcoBwProcessToGenerate.InputAndOutputNameSpace));
            }

            imports.AddRange(this.GenerateXsdImports(tibcoBwProcessToGenerate));

            return(imports.ToArray());
        }
        private void CreateSolutionAndProjectFiles()
        {
            using (var file = new StreamWriter(SolutionDestinationPath + "/GeneratedSolution.sln"))
            {
                file.Write(GeneratedSolution_sln);
            }

            using (var file = new StreamWriter(ProjectDestinationPath + "/GeneratedSolution.csproj"))
            {
                file.Write(GeneratedSolution_csproj);
            }

            using (var file = new StreamWriter(ProjectDestinationPath + "/Properties/AssemblyInfo.cs"))
            {
                file.Write(AssemblyInfo_cs);
            }

            using (var file = new StreamWriter(ProjectDestinationPath + GetFileSeparator() + ConvertNamespaceToPath(TargetAppNameSpaceService.xmlToolsNameSpace()) + "/TibcoXslHelper.cs"))
            {
                file.Write(TibcoXslHelper_cs);
            }
        }
        private void CreateSolutionDirectory()
        {
            if (Directory.Exists(SolutionDestinationPath) &&
                ConfigurationApp.GetProperty("IsGeneratedSolutionDirectoryPurged") != "true")
            {
                Directory.Delete(SolutionDestinationPath, true);
                ConfigurationApp.SaveProperty("IsGeneratedSolutionDirectoryPurged", "true");
            }

            Directory.CreateDirectory(SolutionDestinationPath);
            Directory.CreateDirectory(ProjectDestinationPath);
            Directory.CreateDirectory(ProjectDestinationPath + "/Properties");
            Directory.CreateDirectory(ProjectDestinationPath + "/" + ConvertNamespaceToPath(TargetAppNameSpaceService.xmlToolsNameSpace()));
        }
Exemple #7
0
 public override List <CodeNamespaceImport> GenerateImports(Activity activity)
 {
     return(new List <CodeNamespaceImport> {
         new CodeNamespaceImport(TargetAppNameSpaceService.xmlToolsNameSpace())
     });
 }