/// <summary>
        /// Attach the current project with module loading
        /// </summary>
        protected override void Load(IModuleManager moduleManager, ICommandLine commandLine)
        {
            // create a new instance of the analysis engine module. Module will be isolated from Windows
            // ApplicationManager GetService chain.
            // engine = new AnalysisEngine(moduleManager, null);

            base.Load(moduleManager, commandLine);

            try
            {
                 //Attach CurrentProject
                Configuration config = Configuration.GetNewInstance();
                string filePath = config.CurrentProjectFilePath;
                if (!string.IsNullOrEmpty(filePath))
                {

                    // Try to open the current project in the configuration file.
                    // If the project can't be opened, recover from the error and update the configuration file.
                    try
                    {
                        CurrentProject = new Project(filePath);
                    }
                    catch (Exception ex)
                    {
                        MsgBox.ShowException(ex);
                        config.CurrentProjectFilePath = string.Empty;
                        Configuration.Save(config);
                    }
                }

                if (form == null)
                {
                    base.OnLoaded();
                    form = new Forms.AnalysisMainForm(this);
                    container.Add(form);
                    form.Closed += new EventHandler(MainForm_Closed);
                    form.Disposed += new EventHandler(MainForm_Disposed);
                    form.Show();
                    if (!Util.IsEmpty(form))
                    {
                        form.Activate();

                        // assure handle creation
                        System.IntPtr handle = form.Handle;

                        // read the command line
                        if (commandLine != null)
                        {
                            string titleArgument = commandLine.GetArgument("title");
                            if (titleArgument != null)
                            {
                                form.Text = titleArgument;
                            }
                        }
                    }
                }
                else
                {
                    if (!form.IsDisposed)
                    {
                        form.Show();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                    }
                }
                //zack 1/2/08
                //Processor.CommunicateUI += new CommunicateUIEventHandler(MsgResponse);

                // KKM4 Commented this out since HandleDialogEvent is never raised.
                // Processor.HandleDialogEvent += new DialogBoxUIEventHandler(DialogResponse); //dcs0 4/23/08

            }
            catch (Exception ex)
            {
                throw new GeneralException(SharedStrings.MODULE_NOT_LOADED + ": \n" + ex.Message, ex);
            }
            finally
            {
                if (Util.IsEmpty(form))
                {
                    this.Dispose();
                    Application.ExitThread();
                }
            }
        }
        /// <summary>
        /// Attach the current project with module loading
        /// </summary>
        protected override void Load(IModuleManager moduleManager, ICommandLine commandLine)
        {

            // create a new instance of the analysis engine module. Module will be isolated from Windows
            // ApplicationManager GetService chain.
            // engine = new AnalysisEngine(moduleManager, null);
            
            base.Load(moduleManager, commandLine);

            try
            {
                 //Attach CurrentProject
                Configuration config = Configuration.GetNewInstance();
                string filePath = config.CurrentProjectFilePath;
                if (!string.IsNullOrEmpty(filePath))
                {

                    // Try to open the current project in the configuration file.
                    // If the project can't be opened, recover from the error and update the configuration file.
                    try
                    {
                        CurrentProject = new Project(filePath);
                    }
                    catch (Exception ex)
                    {
                        MsgBox.ShowException(ex);
                        config.CurrentProjectFilePath = string.Empty;
                        Configuration.Save(config);
                    }
                }

                if (form == null)
                {
                    base.OnLoaded();
                    form = new Forms.AnalysisMainForm(this);
                    container.Add(form);
                    form.Closed += new EventHandler(MainForm_Closed);
                    form.Disposed += new EventHandler(MainForm_Disposed);
                    form.Show();
                    if (!Util.IsEmpty(form))
                    {
                        form.Activate();

                        // assure handle creation
                        System.IntPtr handle = form.Handle;

                        // read the command line
                        if (commandLine != null)
                        {
                            string titleArgument = commandLine.GetArgument("title");
                            if (titleArgument != null)
                            {
                                form.Text = titleArgument;
                            }
                        }
                    }
                }
                else
                {
                    if (!form.IsDisposed)
                    {
                        form.Show();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                    }
                }
                //zack 1/2/08
                //Processor.CommunicateUI += new CommunicateUIEventHandler(MsgResponse);

                // KKM4 Commented this out since HandleDialogEvent is never raised.
                // Processor.HandleDialogEvent += new DialogBoxUIEventHandler(DialogResponse); //dcs0 4/23/08
               
            }
            catch (Exception ex)
            {
                throw new GeneralException(SharedStrings.MODULE_NOT_LOADED + ": \n" + ex.Message, ex);
            }
            finally
            {
                if (Util.IsEmpty(form))
                {
                    this.Dispose();
                    Application.ExitThread();  
                }
            }
        }