private void btnStep_Click(object sender, EventArgs e) { tmrTime.Stop(); btnStartStop.Text = Constant.START; Biz.GetAllLife(); Biz.NextGeneration(); }
private void btnClear_Click(object sender, EventArgs e) { tmrTime.Stop(); btnStartStop.Text = Constant.START; isOK = false; Biz.InitGrid(); Biz.GetAllLife(); for (int i = 0; i < 5; i++) { FileStream fs = new FileStream("res" + (i + 1) + ".txt", FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter(fs); sw.Close(); fs.Close(); } }
private void btnStartStop_Click(object sender, EventArgs e) { if (btnStartStop.Text == Constant.START) { if (!isOK) { Biz.RandomSeed(); isOK = true; } Biz.GetAllLife(); tmrTime.Start(); btnStartStop.Text = Constant.STOP; } else { btnStartStop.Text = Constant.START; tmrTime.Stop(); } }
private void FormMain_Load(object sender, EventArgs e) { Biz.InitGrid(); Biz.GetAllLife(); }