private void MinerController(bool halt)
{
if (buStart.Text == "Start Miner" && !halt)
{
if (dgView.Rows.Count > 0)
{
this.Icon = Properties.Resources.dminer_on;
trayIcon.Icon = Properties.Resources.dminer_on;
tsStatus.Text = "Status: Sending miner into a hole...";
tsTime.Text = "Time Elapsed: 0 min.";
bg_tray.RunWorkerAsync();
bg_monitor.RunWorkerAsync();
bg_minemgr.RunWorkerAsync();
buStart.Enabled = false;
buStart.ForeColor = Color.DarkRed;
buStart.Text = "Stop Miner";
tsStart.Enabled = false;
tsStart.Text = "Stop Miner";
}
else
MessageBox.Show("You have to add a miner before you can put one to work!");
}
else
{
this.Icon = Properties.Resources.dminer_off;
trayIcon.Icon = Properties.Resources.dminer_off;
buStart.Enabled = false;
tsStart.Enabled = false;
bg_tray.CancelAsync();
bg_monitor.CancelAsync();
bg_minemgr.CancelAsync();
SendControlC(p);
tsStatus.Text = "Status: Ready...";
buStart.ForeColor = Color.DarkGreen;
buStart.Text = "Start Miner";
tsStart.Text = "Start Miner";
laActive.Text = "Active Miner: N/A";
}
}