private void MainForm_Load(object sender, EventArgs e)
        {
            Config = configProvider.GetConfiguration();
            IntPtr wHandle = FindWindowEx(IntPtr.Zero, IntPtr.Zero, null, Config.CtxWindowTitle);

            if (wHandle == IntPtr.Zero)
            {
                CheckIPandStartCTX();
            }
            else
            {
                ShowWindow(wHandle, 3);
                SetForegroundWindow(wHandle);
                Application.Exit();
            }
        }
        ///
        public virtual void Initialize(IModuleContainerFactory containerFactory, IModuleManager moduleManager, IConfigProvider configProvider)
        {
            RegionConfig = configProvider.GetConfiguration <ShellRegionConfig>();

            // Initialize config if necessary
            if (!RegionConfig.Initialized)
            {
                BuildConfig(RegionConfig);
                RegionConfig.Initialized = true;
                configProvider.SaveConfiguration(RegionConfig);
            }

            // Load components from local assembly, inherited assembly and regions from directory
            ShellContainer = containerFactory.Create(new Dictionary <Type, string>(), GetType().Assembly);

            // Register region plugins in local container
            foreach (var module in moduleManager.EnabledModules.OfType <IRegionModule>())
            {
                ShellContainer.SetInstance(module, module.Name);
            }

            LoadPlugins(ShellContainer);
        }