예제 #1
0
 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());
     }
 }
예제 #2
0
 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);
     }
 }