static void Button_ButtonPressed(Button sender, Button.ButtonState state) { // テスト用のスレッドが動作していれば破棄 if (_th != null) { _th.Suspend(); } // 次のテストの前に全ての LED を消す _peach.TurnAllLedsOff(); // 次のテストを始める _testIndex = (_testIndex + 1) % TestMax; _th = new Thread(Tests[_testIndex]); _th.Start(); }