예제 #1
0
        private void buttonStartServer_Click(object sender, EventArgs e)
        {
            if (nmeaServer == null || !nmeaServer.Started)
            {
                nmeaServer = new NMEAServer(ref boatData, Convert.ToInt32(numericUpDownPort.Value), Convert.ToInt32(numericUpDownRate.Value));
                nmeaServer.Start();
                buttonStartServer.Text = "Stop server";
            }
            else
            {
                nmeaServer.Stop();
                buttonStartServer.Text = "Start server";
            }

            numericUpDownPort.Enabled = !nmeaServer.Started;
            numericUpDownRate.Enabled = !nmeaServer.Started;
        }
예제 #2
0
 public void StopSelectedBoatDataRefreshTask()
 {
     if (SelectedBoatCancellationTokenSource != null)
     {
         SelectedBoatCancellationTokenSource.Cancel();
         NmeaServer.Stop();
         MessageHub.PublishAsync(new BoatDataServiceStatusChanged(Global.Instance, false));
     }
 }