예제 #1
0
 public void DisconnectWarThunder()
 {
     lock (lockWarThunder)
     {
         if (currentAircraft != null)
         {
             try
             {
                 Utils.SetProperty<Label, String>(labelCurrentAircraft, "Text", DISABLEDOPTION);
                 currentAircraft.StopPoll();
                 currentAircraft = null;
             }
             catch {
                 Debug.Print("DisconnectWarThunder error");
             }
         }
     }
 }
예제 #2
0
        public void ConnectWarThunder()
        {
            lock (lockWarThunder)
            {
                if (!_settings.warThunderTrackAircraft)
                {
                    Utils.SetProperty<Label, String>(labelCurrentAircraft, "Text", DISABLEDOPTION);
                    return;
                }
                else
                {
                    if (currentAircraft == null)
                    {
                        currentAircraft = new WTAircraft();
                        currentAircraft.OnError += new EventHandler<EventArgsString>(currentAircraft_OnError);
                        currentAircraft.AircraftChange += new EventHandler<EventArgsString>(wtCurrentAircraft_AircraftChange);                        
                        currentAircraft.StartPoll();
                    }
                    Utils.SetProperty<Label, String>(labelCurrentAircraft, "Text", WAITSPAWN);

                }
            }
        }