From 5613378a3842397340d6b2b5f6aff6f70a42423e Mon Sep 17 00:00:00 2001 From: fahminlb33 Date: Sun, 28 Feb 2021 11:06:59 +0700 Subject: [PATCH] Refactor app context and ioc container --- ...ext.cs => KFlearningApplicationContext.cs} | 4 ++-- ...aller.cs => KFlearningModulesInstaller.cs} | 19 +++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) rename src/KFlearning/Services/{CustomApplicationContext.cs => KFlearningApplicationContext.cs} (85%) rename src/KFlearning/Services/{AppModulesInstaller.cs => KFlearningModulesInstaller.cs} (66%) diff --git a/src/KFlearning/Services/CustomApplicationContext.cs b/src/KFlearning/Services/KFlearningApplicationContext.cs similarity index 85% rename from src/KFlearning/Services/CustomApplicationContext.cs rename to src/KFlearning/Services/KFlearningApplicationContext.cs index 2c31245..8aa790c 100644 --- a/src/KFlearning/Services/CustomApplicationContext.cs +++ b/src/KFlearning/Services/KFlearningApplicationContext.cs @@ -5,12 +5,12 @@ namespace KFlearning.Services { - public class CustomApplicationContext : ApplicationContext + public class KFlearningApplicationContext : ApplicationContext { private readonly ITelemetryService _telemetry; private Form _mainForm; - public CustomApplicationContext(ITelemetryService telemetryService, StartupForm form) + public KFlearningApplicationContext(ITelemetryService telemetryService, StartupForm form) { _telemetry = telemetryService; _mainForm = form; diff --git a/src/KFlearning/Services/AppModulesInstaller.cs b/src/KFlearning/Services/KFlearningModulesInstaller.cs similarity index 66% rename from src/KFlearning/Services/AppModulesInstaller.cs rename to src/KFlearning/Services/KFlearningModulesInstaller.cs index 98c8752..aed8041 100644 --- a/src/KFlearning/Services/AppModulesInstaller.cs +++ b/src/KFlearning/Services/KFlearningModulesInstaller.cs @@ -1,21 +1,12 @@ -// SOLUTION : KFlearning -// PROJECT : KFlearning -// FILENAME : AppModulesInstaller.cs -// AUTHOR : Fahmi Noor Fiqri, Kodesiana.com -// WEBSITE : https://kodesiana.com -// REPO : https://github.com/Kodesiana or https://github.com/fahminlb33 -// -// This file is part of KFlearning, see LICENSE. -// See this code in repository URL above! - -using Castle.MicroKernel.Registration; +using Castle.MicroKernel.Registration; using Castle.MicroKernel.SubSystems.Configuration; using Castle.Windsor; +using KFlearning.TemplateProvider; using KFlearning.Views; namespace KFlearning.Services { - public class AppModulesInstaller : IWindsorInstaller + public class KFlearningModulesInstaller : IWindsorInstaller { public void Install(IWindsorContainer container, IConfigurationStore store) { @@ -26,9 +17,9 @@ public void Install(IWindsorContainer container, IConfigurationStore store) .LifestyleTransient(), // services - Component.For().LifestyleSingleton(), + Component.For().LifestyleSingleton(), Classes.FromThisAssembly() - .InSameNamespaceAs() + .InSameNamespaceAs() .WithServiceDefaultInterfaces() .WithServiceAllInterfaces() .LifestyleSingleton(),