public override List <CodeNamespaceImport> GenerateImports(Activity activity)
 {
     return(new List <CodeNamespaceImport>
     {
         new CodeNamespaceImport(TargetAppNameSpaceService.EngineCommandNamespace())
     });
 }
Esempio n. 2
0
        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 engineCommandNamespace = new CodeNamespace(TargetAppNameSpaceService.EngineCommandNamespace());

            // Generate the Service
            engineCommandNamespace.Imports.AddRange(this.GenerateImports());
            var engineCommandServiceClass = this.GenerateClass();

            engineCommandNamespace.Types.Add(engineCommandServiceClass);

            // Generate the corresponding interface
            var engineCommandInterface = InterfaceExtractorFromClass.Extract(engineCommandServiceClass, TargetAppNameSpaceService.EngineCommandNamespace());

            engineCommandInterface.Types.AddRange(this.GenerateReturnOutputClasses());

            ModuleBuilder.AddServiceToRegister(IEngineCommandServiceName, EngineCommandServiceName);
            return(new CodeNamespaceCollection {
                engineCommandNamespace, engineCommandInterface
            });
        }