private void Handle(ApplicationEvent @event)
 {
     _initializations.Add(new Initializations(
                              usings: @event.GetValue(InitializationRequiredEvent.UsingsKey),
                              code: @event.GetValue(InitializationRequiredEvent.CallKey),
                              method: @event.TryGetValue(InitializationRequiredEvent.MethodKey),
                              priority: @event.TryGetValue(InitializationRequiredEvent.PriorityKey)));
 }
예제 #2
0
 private void HandleInitialization(ApplicationEvent @event)
 {
     _initializations.Add(new Initializations(
                              usings: @event.GetValue(InitializationRequiredEvent.UsingsKey),
                              code: @event.GetValue(InitializationRequiredEvent.CallKey),
                              method: @event.TryGetValue(InitializationRequiredEvent.MethodKey),
                              priority: int.TryParse(@event.TryGetValue(InitializationRequiredEvent.PriorityKey), out var priority) ? priority : 0,
                              templateDependency: @event.TryGetValue(InitializationRequiredEvent.TemplateDependencyIdKey) != null ? TemplateDependancy.OnTemplate(@event.TryGetValue(InitializationRequiredEvent.TemplateDependencyIdKey)) : null));
 }
예제 #3
0
 private void HandleServiceConfiguration(ApplicationEvent @event)
 {
     _serviceConfigurations.Add(new Initializations(
                                    usings: @event.GetValue(ServiceConfigurationRequiredEvent.UsingsKey),
                                    code: @event.GetValue(ServiceConfigurationRequiredEvent.CallKey),
                                    method: @event.TryGetValue(ServiceConfigurationRequiredEvent.MethodKey),
                                    priority: int.TryParse(@event.TryGetValue(ServiceConfigurationRequiredEvent.PriorityKey), out var priority) ? priority : 0,
                                    templateDependency: null));
 }
예제 #4
0
 private void Handle(ApplicationEvent @event)
 {
     Profiles.Add(@event.GetValue(LaunchProfileRegistrationEvent.ProfileNameKey), new Profile
     {
         commandName    = @event.GetValue(LaunchProfileRegistrationEvent.CommandNameKey),
         launchBrowser  = bool.TryParse(@event.GetValue(LaunchProfileRegistrationEvent.LaunchBrowserKey), out var launchBrowser) && launchBrowser,
         launchUrl      = @event.TryGetValue(LaunchProfileRegistrationEvent.LaunchUrlKey),
         applicationUrl = @event.TryGetValue(LaunchProfileRegistrationEvent.ApplicationUrl),
     });
 private void Handle(ApplicationEvent @event)
 {
     Profiles.Add(@event.GetValue(LaunchProfileRegistrationEvent.ProfileNameKey), new Profile
     {
         commandName     = @event.GetValue(LaunchProfileRegistrationEvent.CommandNameKey),
         launchBrowser   = bool.TryParse(@event.GetValue(LaunchProfileRegistrationEvent.LaunchBrowserKey), out var launchBrowser) && launchBrowser,
         launchUrl       = @event.TryGetValue(LaunchProfileRegistrationEvent.LaunchUrlKey),
         applicationUrl  = @event.TryGetValue(LaunchProfileRegistrationEvent.ApplicationUrl),
         publishAllPorts = bool.TryParse(@event.TryGetValue(LaunchProfileRegistrationEvent.PublishAllPorts), out var publishAllPorts) && publishAllPorts,
         useSSL          = bool.TryParse(@event.TryGetValue(LaunchProfileRegistrationEvent.UseSSL), out var useSSL) && useSSL,
     });
예제 #6
0
 private void HandleConnectionString(ApplicationEvent @event)
 {
     if (_connectionStrings.ContainsKey(@event.GetValue("Name")))
     {
         if (_connectionStrings[@event.GetValue("Name")].ConnectionString != @event.GetValue("ConnectionString"))
         {
             throw new Exception($"Misconfiguration in [{GetType().Name}]: ConnectionString with name [{@event.GetValue("Name")}] already defined with different value to [{@event.GetValue("ConnectionString")}].");
         }
         return;
     }
     _connectionStrings.Add(@event.GetValue("Name"), new ConnectionStringElement(name: @event.GetValue("Name"), connectionString: @event.GetValue("ConnectionString"), providerName: @event.GetValue("ProviderName")));
 }
예제 #7
0
 private void HandleAppSetting(ApplicationEvent @event)
 {
     if (_appSettings.ContainsKey(@event.GetValue("Key")))
     {
         if (_appSettings[@event.GetValue("Key")] != @event.GetValue("Value"))
         {
             // TODO: Do not commit
             //throw new Exception($"Misconfiguration in [{GetType().Name}]: AppSetting with key [{@event.Key}] already defined with different value to [{@event.Value}].");
         }
         return;
     }
     _appSettings.Add(@event.GetValue("Key"), @event.GetValue("Value"));
 }
예제 #8
0
        private void Handle(ApplicationEvent @event)
        {
            if (ConfigItems.ContainsKey(@event.GetValue("Key")))
            {
                if (ConfigItems[@event.GetValue("Key")] != @event.GetValue("Value"))
                {
                    throw new Exception($"Misconfiguration in [{GetType().Name}]: Config with key [{@event.GetValue("Key")}] already defined with different value to [{@event.GetValue("Value")}].");
                }
                return;
            }

            ConfigItems.Add(@event.GetValue("Key"), @event.GetValue("Value"));
            ConfigItems = ConfigItems.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
        }
예제 #9
0
 private void HandleDbContextRegistration(ApplicationEvent @event)
 {
     _dbContextRegistrations.Add(new DbContextContainerRegistration(
                                     @event.TryGetValue(ContainerRegistrationForDbContextEvent.UsingsKey),
                                     @event.GetValue(ContainerRegistrationForDbContextEvent.ConcreteTypeKey),
                                     @event.TryGetValue(ContainerRegistrationForDbContextEvent.ConcreteTypeTemplateIdKey) != null ? TemplateDependancy.OnTemplate(@event.TryGetValue(ContainerRegistrationForDbContextEvent.ConcreteTypeTemplateIdKey)) : null,
                                     @event.TryGetValue(ContainerRegistrationForDbContextEvent.OptionsKey)));
 }
예제 #10
0
 private void Handle(ApplicationEvent @event)
 {
     _registrations.Add(new ContainerRegistration(
                            interfaceType: @event.TryGetValue(ContainerRegistrationEvent.InterfaceTypeKey),
                            concreteType: @event.GetValue(ContainerRegistrationEvent.ConcreteTypeKey),
                            lifetime: @event.TryGetValue(ContainerRegistrationEvent.LifetimeKey),
                            interfaceTypeTemplateDependency: @event.TryGetValue(ContainerRegistrationEvent.InterfaceTypeTemplateIdKey) != null ? TemplateDependancy.OnTemplate(@event.TryGetValue(ContainerRegistrationEvent.InterfaceTypeTemplateIdKey)) : null,
                            concreteTypeTemplateDependency: @event.TryGetValue(ContainerRegistrationEvent.ConcreteTypeTemplateIdKey) != null ? TemplateDependancy.OnTemplate(@event.TryGetValue(ContainerRegistrationEvent.ConcreteTypeTemplateIdKey)) : null));
 }
예제 #11
0
 private void HandleServiceRegistration(ApplicationEvent @event)
 {
     _registrations.Add(new ContainerRegistration(
                            interfaceType: @event.TryGetValue("InterfaceType"),
                            concreteType: @event.GetValue("ConcreteType"),
                            lifetime: @event.TryGetValue("Lifetime"),
                            interfaceTypeTemplateDependency: @event.TryGetValue("InterfaceTypeTemplateId") != null ? TemplateDependancy.OnTemplate(@event.TryGetValue("InterfaceTypeTemplateId")) : null,
                            concreteTypeTemplateDependency: @event.TryGetValue("ConcreteTypeTemplateId") != null ? TemplateDependancy.OnTemplate(@event.TryGetValue("ConcreteTypeTemplateId")) : null));
 }
예제 #12
0
 private void Handle(ApplicationEvent @event)
 {
     AngularModules.Add(@event.GetValue("ModuleName"));
 }
예제 #13
0
 private void Handle(ApplicationEvent @event)
 {
     DevDependencies.Add(@event.GetValue("name"), @event.GetValue("version"));
 }
 private void Handle(ApplicationEvent @event)
 {
     _eventedJsFiles.Add(@event.GetValue("Src"));
 }
예제 #15
0
 private void Handle(ApplicationEvent @event)
 {
     _registrations.Add(new ContainerRegistration(@event.GetValue("InterfaceType"), @event.GetValue("ConcreteType"), @event.TryGetValue("Lifetime")));
 }