Exemplo n.º 1
0
        private void buttonStartStop_Click(object sender, EventArgs e)
        {
            if (currentHunting != null)
            {
                currentHunting.StopHunting();
                currentHunting = null;

                buttonStartStop.Text = "Start Hunting";
            }
            else
            {
                if (comboBoxHuntingTypes.SelectedIndex != -1)
                {
                    var huntingType = (HuntingType)comboBoxHuntingTypes.SelectedItem;
                    currentHunting = huntingType.CreateInstance();
                    currentHunting.Initialize();
                    currentHunting.StartHunting();

                    RefreshWallet();
                    //RefreshOrders();

                    buttonStartStop.Text = "Stop Hunting";
                }
                else
                {
                    MessageBox.Show("Hunting type is not selected!");
                }
            }
        }
Exemplo n.º 2
0
        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var formSettings = new FormSettings();

            if (formSettings.ShowDialog(this) == DialogResult.OK)
            {
                SettingsHelper.Instance.Invalidate();

                if (currentHunting != null)
                {
                    if (ShowQuestion("Do you want to stop current hunting process?") == DialogResult.Yes)
                    {
                        currentHunting.StopHunting();
                        currentHunting = null;

                        buttonStartStop.Text = "Start Hunting";
                    }
                }
            }
        }