private void UpdateButton(Button button, Color color) { if (button.InvokeRequired) { UpdateButtonDelegate d = new UpdateButtonDelegate(UpdateButton); button.Invoke(d, new object[] { button, color }); } else { button.BackColor = color; } }
private void UpdateButton(Button button, bool isLive) { if (button.InvokeRequired) { UpdateButtonDelegate d = new UpdateButtonDelegate(UpdateButton); button.Invoke(d, new object[] { button, isLive }); } else { if (!isLive) { button.BackColor = deadCellColor; } else { button.BackColor = liveCellColor; } } }