public ExecutorContainerWrapper()
        {
            _container = new ExecutorContainer();
            _container.ReadConfig(false);
            Config = _container.Config;

            //_container.NonDedicatedExecutingStatusChanged += new NonDedicatedExecutingStatusChangedEventHandler(this.RefreshUIControls);
            _container.GotDisconnected += new GotDisconnectedEventHandler(this.Executor_GotDisconnected);
            _container.ExecConnectEvent += new ExecutorConnectStatusEventHandler(this.ExecutorConnect_Status);

            //now application should refresh ui with config values
        }
Ejemplo n.º 2
0
        private void ExecutorMainForm_Load(object sender, EventArgs e)
        {
            Logger.LogHandler += new LogEventHandler(this.LogHandler);

            //not a service. normal exec startup mode.
            _container = new ExecutorContainer();
            _container.ReadConfig(false);
            Config = _container.Config;

            this.btConnect.Text = "Connect";
            this.btDisconnect.Text = "Disconnect";

            _container.NonDedicatedExecutingStatusChanged += new NonDedicatedExecutingStatusChangedEventHandler(this.RefreshUIControls);
            _container.GotDisconnected += new GotDisconnectedEventHandler(this.Executor_GotDisconnected);
            //_container.ExecConnectEvent += new ExecutorConnectStatusEventHandler(this.ExecutorConnect_Status);

            ConnectOnStartup();

            RefreshUIControls();
            btConnect.Focus();
        }
Ejemplo n.º 3
0
        private void ExecutorMainForm_Load(object sender, EventArgs e)
        {
            //this should normally not create any problems, but then during design time it doesnt work, so we need to catch any exceptions
            //that may occur during design time.
            try
            {
                // avoid multiple instances
                bool isOnlyInstance = false;
                Mutex mtx = new Mutex(true, "AlchemiExecutorServiceController_Mutex", out isOnlyInstance);
                if(!isOnlyInstance)
                {
                    MessageBox.Show(this,"An instance of this application is already running. The program will now exit.", "Alchemi Executor Service Controller", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Application.Exit();
                }

                Logger.LogHandler += new LogEventHandler(this.LogHandler);

                //this is a service. just read the config.
                ExecutorContainer ec = new ExecutorContainer();
                ec.ReadConfig(false);
                Config = ec.Config;
                ec = null;

                this.btConnect.Text = "Start";
                this.btDisconnect.Text = "Stop";

                RefreshUIControls();
                btConnect.Focus();
            }
            catch {}
        }
Ejemplo n.º 4
0
 protected override void ResetExecutor()
 {
     ExecutorContainer ec = new ExecutorContainer();
     ec.ReadConfig(true);
     Config = ec.Config;
     ec = null;
     RefreshUIControls();
 }