internal static void StartStopComThread() { serial?.Dispose(); if (!string.IsNullOrWhiteSpace(Settings.Model.SerialComId)) { serial = new SerialCom(); SerialCom.Enqueue(Message.SetLedNumber(Settings.Model.TotalLeds)); SerialCom.Enqueue(Message.GetPatterns()); } }
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { try { SaveAppConfig(); if (_appConfig.PreserveHistory) { richTextBoxExEventLog.SaveFile(EventLogFilename, RichTextBoxStreamType.RichText); } if (_serialCom != null) { _serialCom.Dispose(); } } catch (Exception ex) { PopupException(ex.Message); } }