Ejemplo n.º 1
0
 public FormTemplate(FormModel model, ControlWriter controlWriter, IApplicationEventDispatcher eventDispatcher)
 {
     Model         = model;
     ControlWriter = controlWriter;
     eventDispatcher.Publish(new AngularImportDependencyRequiredEvent(
                                 moduleId: Model.Module.Id,
                                 dependency: "ReactiveFormsModule",
                                 import: "import { ReactiveFormsModule } from '@angular/forms';"));
     eventDispatcher.Publish(new AngularImportDependencyRequiredEvent(
                                 moduleId: Model.Module.Id,
                                 dependency: "FormsModule",
                                 import: "import { FormsModule } from '@angular/forms';"));
     if (Model.FormFields.Any(x => x.TypeReference.Element.Name == "Datepicker"))
     {
         eventDispatcher.Publish(new AngularImportDependencyRequiredEvent(
                                     moduleId: Model.Module.Id,
                                     dependency: "BsDatepickerModule.forRoot()",
                                     import: "import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';"));
     }
     if (Model.FormFields.Any(x => x.TypeReference.Element.Name == "Select" || x.TypeReference.Element.Name == "Multi-Select"))
     {
         //eventDispatcher.Publish(new AngularImportDependencyRequiredEvent(
         //    moduleId: Model.Module.Id,
         //    dependency: "NgxSelectModule",
         //    import: "import { NgxSelectModule } from 'ngx-select-ex';"));
         //eventDispatcher.Publish(new CliInstallationRequest("ngx-select-ex", "3", "--save"));
         eventDispatcher.Publish(new AngularImportDependencyRequiredEvent(
                                     moduleId: Model.Module.Id,
                                     dependency: "MatSelectModule",
                                     import: "import { MatSelectModule } from '@angular/material/select';"));
         eventDispatcher.Publish(new CliInstallationRequest("@angular/material", "ng add @angular/material"));
     }
 }
Ejemplo n.º 2
0
 public void PreProcess()
 {
     _applicationEventDispatcher.Publish(ApplicationEvents.Typescript_TypingsRequired, new Dictionary <string, string>()
     {
         { "name", "@types/angular" },
         { "version", "^1.6.2" }
     });
     _applicationEventDispatcher.Publish(ApplicationEvents.Typescript_TypingsRequired, new Dictionary <string, string>()
     {
         { "name", "@types/angular-ui-router" },
         { "version", "^1.1.36" }
     });
 }
Ejemplo n.º 3
0
 public void PreProcess()
 {
     _eventDispatcher.Publish(ApplicationEvents.IndexHtml_JsFileAvailable, new Dictionary <string, string>()
     {
         { "Src", "./js/config.js" }
     });
 }
Ejemplo n.º 4
0
        public void BeforeTemplateExecution()
        {
            _eventDispatcher.Publish(ApplicationEvents.Config_ConnectionString, new Dictionary <string, string>()
            {
                { "Name", $"{Project.Application.ApplicationName}DB" },
                { "ConnectionString", $"Server=.;Initial Catalog={ Project.Application.SolutionName };Integrated Security=true;MultipleActiveResultSets=True" },
                { "ProviderName", "System.Data.SqlClient" },
            });

            _eventDispatcher.Publish(ContainerRegistrationEvent.EventId, new Dictionary <string, string>()
            {
                { "ConcreteType", $"{Namespace}.{ClassName}" },
                { "ConcreteTypeTemplateId", Identifier },
                { "Lifetime", ContainerRegistrationEvent.PerServiceCallLifetime }
            });
        }
Ejemplo n.º 5
0
 public void PreProcess()
 {
     _eventDispatcher.Publish(ApplicationEvents.Container_RegistrationRequired, new Dictionary <string, string>()
     {
         { "InterfaceType", "Intent.Framework.WebApi.ExceptionHandling.IServiceBoundaryExceptionHandlingStrategy" },
         { "ConcreteType", "ServiceBoundaryExceptionHandlingStrategy" }
     });
 }
Ejemplo n.º 6
0
 public void PreProcess()
 {
     _eventDispatcher.Publish(ApplicationEvents.AngularJs_ConfigurationRequired, new Dictionary <string, string>()
     {
         { "Key", ApiBasePathConfigKey },
         { "Value", _hostingConfig.GetBaseUrl() }
     });
 }
Ejemplo n.º 7
0
 public PaginationControlTemplate(PaginationControlModel model, IApplicationEventDispatcher eventDispatcher)
 {
     Model = model;
     eventDispatcher.Publish(new AngularImportDependencyRequiredEvent(
                                 moduleId: Model.Module.Id,
                                 dependency: "PaginationModule.forRoot()",
                                 import: "import { PaginationModule } from 'ngx-bootstrap/pagination';"));
 }
Ejemplo n.º 8
0
        public void BeforeTemplateExecution()
        {
            _eventDispatcher.Publish(ApplicationEvents.Config_ConnectionString, new Dictionary <string, string>()
            {
                { "Name", $"{Project.Application.ApplicationName}DB" },
                { "ConnectionString", $"Server=.;Initial Catalog={Project.Application.SolutionName}.{ Project.Application.ApplicationName };Integrated Security=true;MultipleActiveResultSets=True" },
                { "ProviderName", "System.Data.SqlClient" },
            });

            _eventDispatcher.Publish(ContainerRegistrationForDbContextEvent.EventId, new Dictionary <string, string>()
            {
                { ContainerRegistrationForDbContextEvent.UsingsKey, $"Microsoft.EntityFrameworkCore;" },
                { ContainerRegistrationForDbContextEvent.ConcreteTypeKey, $"{Namespace}.{ClassName}" },
                { ContainerRegistrationForDbContextEvent.ConcreteTypeTemplateIdKey, Identifier },
                { ContainerRegistrationForDbContextEvent.OptionsKey, $@".{GetDbContextDbServerSetupMethodName()}(Configuration.GetConnectionString(""{Project.Application.ApplicationName}DB"")){(UseLazyLoadingProxies ? ".UseLazyLoadingProxies()" : "")}" },
            });
        }
Ejemplo n.º 9
0
 public void PreProcess()
 {
     _eventDispatcher.Publish(ApplicationEvents.Config_ConnectionString, new Dictionary <string, string>()
     {
         { "Name", $"{BoundedContextName}DB" },
         { "ConnectionString", $"Server=.;Initial Catalog={ Project.Application.SolutionName };Integrated Security=true;MultipleActiveResultSets=True" },
         { "ProviderName", "System.Data.SqlClient" },
     });
 }
Ejemplo n.º 10
0
        public void PreProcess()
        {
            var contractTemplate = Project.FindTemplateInstance <IHasClassDetails>(UserContextInterfaceTemplate.Identifier);

            _eventDispatcher.Publish(ApplicationEvents.Container_RegistrationRequired, new Dictionary <string, string>()
            {
                { "InterfaceType", $"Intent.Framework.Core.Context.IUserContextProvider<{contractTemplate.FullTypeName()}>" },
                { "ConcreteType", this.FullTypeName() }
            });
        }
Ejemplo n.º 11
0
        public void PreProcess()
        {
            _applicationEvents.Publish(ApplicationEvents.AngularJs_ModuleRegistered, new Dictionary <string, string>()
            {
                { "ModuleName", "Auth" }
            });
            _applicationEvents.Publish(ApplicationEvents.AngularJs_ConfigurationRequired, new Dictionary <string, string>()
            {
                { "Key", BasePathConfigKey },
                { "Value", _hostingConfig.GetBaseUrl() },
            });

            _solutionEvents.Publish(SolutionEvents.Authentication_ClientRequired, new Dictionary <string, string>()
            {
                { "AuthenticationType", "Implicit" },
                { "ApplicationName", Project.ApplicationName() },
                { "ApplicationUrl", _hostingConfig.GetBaseUrl() },
            });
        }
Ejemplo n.º 12
0
        public void PreProcess()
        {
            var userContextProviderInterface = Project.FindTemplateInstance <IHasClassDetails>(UserContextProviderInterfaceTemplate.Identifier);
            var contractTemplate             = Project.FindTemplateInstance <IHasClassDetails>(UserContextInterfaceTemplate.Identifier);

            _eventDispatcher.Publish(ContainerRegistrationEvent.EventId, new Dictionary <string, string>()
            {
                { "InterfaceType", $"{userContextProviderInterface.FullTypeName()}<{contractTemplate.FullTypeName()}>" },
                { "ConcreteType", this.FullTypeName() }
            });
        }
Ejemplo n.º 13
0
 public void PreProcess()
 {
     _solutionEvents.Publish(SolutionEvents.ResourceAvailable_IdentityServer, new Dictionary <string, string>()
     {
         { "AuthorityUrl", $"{_hostingConfig.GetBaseUrl()}/identity" },
         { "BaseUrl", _hostingConfig.GetBaseUrl() }
     });
     _applicationEvents.Publish(ApplicationEvents.Config_AppSetting, new Dictionary <string, string>()
     {
         { "Key", "IdentityServer.Issuer.Name" },
         { "Value", $"{_hostingConfig.GetBaseUrl()}/identity" }
     });
     _applicationEvents.Publish(ApplicationEvents.Config_AppSetting, new Dictionary <string, string>()
     {
         { "Key", "IdentityServer.Issuer.SigningCertificate.FindType" },
         { "Value", "FindBySubjectName" }
     });
     _applicationEvents.Publish(ApplicationEvents.Config_AppSetting, new Dictionary <string, string>()
     {
         { "Key", "IdentityServer.Issuer.SigningCertificate.FindValue" },
         { "Value", "localhost" }
     });
 }