/// <summary> /// Saves the current state time spent on. /// </summary> void SaveTimer() { StateTimer.Stop(); if (StateTimer.ElapsedMilliseconds >= 1000) { TimerList.Add(new Tuple <string, double> (currentState, StateTimer.ElapsedSeconds)); } StateTimer.Reset(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { StateTimer.Stop(); try { _ = _server.ShutDown(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }