private void OnDisconnectClick() { stop = true; //gracefully closing the connection and the info channel thread model.Stop(); if (t.IsAlive) { if (t != Thread.CurrentThread) { t.Join(); } } Debug.WriteLine("The thread of info channel has successfully finished"); model.Disconnect(); Debug.WriteLine("Successfully disconnected both channels"); }
private void OnDisconnect() { model.Disconnect(); }
/* terminates the connection with the Flight Simulator. * will be used when the user will exit the main window. */ public void Dissconnect(object sender, EventArgs e) { model.Disconnect(); }