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!"); } } }
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"; } } } }