protected internal ApplicationManager()
 {
     TextLogWriter writer = new TextLogWriter(new System.IO.MemoryStream());
     writer.Level = LogLevel.Fatal;
     writer.AutoflushLevel = LogLevel.Fatal;
     writer.IsEnabled = false;
     Logger = new StandardLogger(writer);
 }
        protected virtual void InitializeComponents()
        {
            if (Logger == null)
            {
                Logger = new StandardLogger();
                Logger.Register(new TextWriterBasedWriter(Console.Out));
            }
            if (ServiceProvider == null)
            {
                //if we have a kernel, then let's create a "depency-injection service provider".
                if (Kernel != null) ServiceProvider = new DIServiceProvider(Kernel);
                //otherwise, create a regular, plain service provider
                else ServiceProvider = new ServiceProvider();
            }
            if (PresentationController == null) PresentationController = new PresentationController();
            if (ApplicationModuleManager == null) ApplicationModuleManager = new ApplicationModuleManager();

            ApplicationModuleManager.PresentationController = PresentationController;
            //if the Kernel is present, then link both module managers (from Foundation and from Ninject).
            if (Kernel != null) ApplicationModuleManager.ModuleManager = Kernel.Components.ModuleManager;
        }
        protected virtual void InitializeComponents()
        {
            if (Logger == null)
            {
                TextLogWriter writer = new TextLogWriter(new System.IO.MemoryStream());
                writer.AutoflushLevel = LogLevel.Fatal;
                writer.IsEnabled = false;
                Logger = new StandardLogger(writer);
            }
            if (ServiceProvider == null)
            {
                //if we have a kernel, then let's create a "depency-injection service provider".
                if (Kernel != null) ServiceProvider = new DIServiceProvider(Kernel);
                //otherwise, create a regular, plain service provider
                else ServiceProvider = new ServiceProvider();
            }
            if (PresentationController == null) PresentationController = new PresentationController();
            if (ApplicationModuleManager == null) ApplicationModuleManager = new ApplicationModuleManager();

            ApplicationModuleManager.PresentationController = PresentationController;
            //if the Kernel is present, then link both module managers (from Foundation and from Ninject).
            if (Kernel != null) ApplicationModuleManager.ModuleManager = Kernel.Components.ModuleManager;
        }