private void CapturaHumedad_OnUnloaded(object sender, RoutedEventArgs e) { if (spManager != null) { spManager.Dispose(); } }
/// <summary> /// Gestisce le richieste in entrata. /// </summary> /// <param name="command">string command</param> /// <returns></returns> public string Get(string command, string user) { if (_spManager != null) { string tmp = ""; _user = user; if (command == "$") { _spManager.StartListening(); tmp = requestToSerial(); _pesata = ""; if (tmp.Trim() == "0.0000") { tmp = "-1"; } _spManager.StopListening(); _spManager.Dispose(); } return(tmp.Trim()); } else { return(string.Empty); } }
private void Form_FormClosing(object sender, FormClosingEventArgs e) { if (isStart) { _spManager.StopListening(); } _spManager.Dispose(); }
private void BunifuFlatButton3_Click_1(object sender, EventArgs e) { timer1.Stop(); timer2.Stop(); timer4.Stop(); _spManager.Dispose(); Application.Exit(); }
protected virtual void Dispose(bool disposing) { if (disposing) { spManager.StopUsingPort(); spManager.NewSerialDataReceived -= OnNewSerialDataReceived; spManager.Dispose(); } }
// Exit function public void Exit() { // Stop listening _cmdMessenger.StopListening(); // Dispose Command Messenger _cmdMessenger.Dispose(); // Dispose Serial Port object _serialPortManager.Dispose(); }
private void WaspGUI_FormClosing(object sender, FormClosingEventArgs e) { if (spManager != null) { spManager.StopListening(); spManager.Dispose(); } sw1.Close(); sw2.Close(); sw3.Close(); }
/// <summary> /// evento closing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Closing(object sender, RoutedEventArgs e) { try { if (basculaConectada) { _spManager.Dispose(); } } catch (Exception ex) { Logger.Error(ex); } }
// Exit function public void Exit() { // Stop listening _cmdMessenger.StopListening(); // Dispose Command Messenger _cmdMessenger.Dispose(); // Dispose Serial Port object _serialPortManager.Dispose(); // Pause before stop Console.WriteLine("Press any key to stop..."); Console.ReadKey(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UserControl_Unloaded(object sender, RoutedEventArgs e) { try { if (spManager != null) { spManager.StopListening(); spManager.Dispose(); } } catch (Exception ex) { Logger.Error(ex); } }
/// <summary> /// Evento closing de Corte de ganado /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Closing(object sender, RoutedEventArgs e) { try { if (rfidConectado) { spManagerRFID.Dispose(); } } catch (Exception) { } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { _spManager.Dispose(); }
/// <summary> /// Shutdown serial task properly /// </summary> public void Close() { _serialPortManager.Dispose(); }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { _spManager.Dispose(); notifyIcon1.Icon = null; }
private void LabelPrintingView_VisibleChanged(object sender, EventArgs e) { _spManager.Dispose(); }