//the ignore connection flag with prevent reinitilization of the connection if the connection is not null public void Start(bool ignoreconn) { if (connection != null && !ignoreconn) { Stop(false); } if (connection == null) { connection = new PanelConnection(connprop); } monitor_thread = GenerateMonitor(); monitor_thread.Start(); }
public void Stop(bool ignoreconn) { if (monitor_thread != null) { running = false; while (monitor_thread.IsAlive) { ; } } if (connection != null && !ignoreconn) { while (connection.Busy) { ; } connection.Stop(); connection = null; } }