Пример #1
0
 public async void StopReceive()
 {
     try
     {
         isRun = false;
         if(isReceive)
         {
             await udpSocket.CancelIOAsync();
             udpSocket.MessageReceived -= UdpSocket_MessageReceived;
             isReceive = false;
         }
             
     }
     finally
     {
         if(udpSocket != null)
         {
             udpSocket.Dispose();
             udpSocket = null;
         }
         
         _Instance = null;
     }
 }
Пример #2
0
        private async void StartTrace(StackPanel srcObject)
        {
            ListViewItem item = (ListViewItem)srcObject.Parent;
            vw_Menu.IsPaneOpen = false;
            isTrace = !isTrace;
            if(isTrace)
            {
                item.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                xReceiver = Control.xTraceGPSEFISReceiver.GetInstance();
                xReceiver.onXPlaneStatReceived += XReceiver_onXPlaneStatReceived;
                Control.xTraceGPSEFISReceiver.GetInstance().StartReceiveAsync();
                dlgTrace = new Views.Dlg_StartTrace();
                await dlgTrace.ShowAsync();
                
            }
            else
            {
                item.Background = new SolidColorBrush(Windows.UI.Colors.Transparent);
                Control.xTraceGPSEFISReceiver.GetInstance().StopReceive();
                themapitmes.ItemsSource = null;
                cmd_MyFlight.IsEnabled = false;
                
            }

            list_Menu.SelectedItem = null;
        }
Пример #3
0
 public static xTraceGPSEFISReceiver GetInstance()
 {
     if (_Instance == null)
         _Instance = new xTraceGPSEFISReceiver();
     return _Instance;
 }