Example #1
0
        private void buttonMount_Click(object sender, EventArgs e)
        {
            MainGhost = new Ghost();
            Ghosts.Add(MainGhost);

            MainGhost.OnUpdate += ThreadSafeUpdate;
            try
            {
                MainGhost.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
                MainGhost = null;
                return;
            }

            buttonMount.Enabled = false;
            buttonUmount.Enabled = true;
            radioButtonAutomatic.Enabled = false;
            radioButtonManual.Enabled = false;
        }
Example #2
0
        private void buttonUmount_Click(object sender, EventArgs e)
        {
            try
            {
                MainGhost.Stop();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
                return;
            }

            MainGhost = null;

            buttonUmount.Enabled = false;
            buttonMount.Enabled = true;
            radioButtonManual.Enabled = true;
            radioButtonAutomatic.Enabled = true;
        }
Example #3
0
        private void timerUmount_Tick(object sender, EventArgs e)
        {
            timerUmount.Stop();
            try
            {
                MainGhost.Stop();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
                return;
            }

            MainGhost = null;

            labelAutomaticInProgress.Hide();
            radioButtonAutomatic.Enabled = true;
            radioButtonManual.Enabled = true;

            timerGhost.Start();
        }
Example #4
0
        private void timerGhost_Tick(object sender, EventArgs e)
        {
            timerGhost.Stop();

            radioButtonAutomatic.Enabled = false;
            radioButtonManual.Enabled = false;
            labelAutomaticInProgress.Show();

            MainGhost = new Ghost();
            Ghosts.Add(MainGhost);
            MainGhost.OnUpdate += ThreadSafeUpdate;

            try
            {
                MainGhost.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
                MainGhost = null;
                return;
            }

            timerUmount.Interval = (int)Properties.Settings.Default.MountDuration * 1000;
            timerUmount.Start();
        }