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)));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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,
     });
Esempio n. 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")));
 }
Esempio n. 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"));
 }
Esempio n. 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);
        }
Esempio n. 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)));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 12
0
 private void Handle(ApplicationEvent @event)
 {
     AngularModules.Add(@event.GetValue("ModuleName"));
 }
Esempio n. 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"));
 }
Esempio n. 15
0
 private void Handle(ApplicationEvent @event)
 {
     _registrations.Add(new ContainerRegistration(@event.GetValue("InterfaceType"), @event.GetValue("ConcreteType"), @event.TryGetValue("Lifetime")));
 }