Example #1
0
        public bool CheckParams()
        {
            if (Executable == string.Empty)
            {
                MessageBox.Show("You must enter an executable file to run.", "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (!File.Exists(Executable))
            {
                MessageBox.Show("Executable does not exist.", "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            using (var tempEngine = new DummyDataEngine())
            {
                bool used = LauncherCommon.TestConnection("localhost", ListenPort, tempEngine);
                if (used)
                {
                    DialogResult result = MessageBox.Show("This port appears to be in use already. Continue anyway?",
                                                          "Port In Use", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (result == DialogResult.No)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Example #2
0
        public virtual bool CheckParams()
        {
            using (var tempEngine = new DummyDataEngine())
            {
                bool used = LauncherCommon.TestConnection("localhost", ListenPort, tempEngine);
                if (used)
                {
                    DialogResult result = MessageBox.Show("This port appears to be in use already. Continue anyway?",
                                                          "Port In Use", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (result == DialogResult.No)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }