Esempio n. 1
0
        public static ModelSelection GetSingleton()
        {
            if (singleton == null || singleton.IsDisposed)
            {
                singleton = new ModelSelection();
            }
            else
            {
                singleton.BringToFront();
            }

            return singleton;
        }
Esempio n. 2
0
        /// <summary>
        /// Execution of the Action.
        /// </summary>
        /// <returns>True:  Execution of the Action was successful</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            // TODO:
            // Add code
            UI.ModelSelection form = UI.ModelSelection.GetSingleton();
            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                UI.MainForm mainForm = UI.MainForm.GetSingleton();

                if (mainForm.Visible)
                {
                    mainForm.BringToFront();
                }
                else
                {
                    mainForm.MvProject = new Data.MvProject(form.IsShip, form.ModelName, form.Number);
                    mainForm.Show(new Util.WindowWrapper(Process.GetCurrentProcess().MainWindowHandle));
                }
            }

            form.Dispose();
            return(true);
        }