private void button_ButtonPressed(Button sender, Button.ButtonState state) { if (sender.IsLedOn) { _timer.Stop(); if (_sw != null) { _sw.Flush(); _sw.Close(); } } else { OpenFile(); _timer.Start(); } sender.ToggleLED(); }
private void button_ButtonPressed(Button sender, Button.ButtonState state) { if (sender.IsLedOn) { _timer.Stop(); if (_sw != null) { _sw.Flush(); _sw.Close(); } } else { OpenFile(); _timer.Start(); } sender.ToggleLED(); }