Ejemplo n.º 1
0
 public void Dispose()
 {
     if (communicationModule != null)
     {
         communicationModule.Dispose();
         communicationModule = null;
     }
 }        
Ejemplo n.º 2
0
        async void InitializeClient()
        {
            Diag.DebugPrint("Initializing client");

            communicationModule = new CommunicationModule();

            // Lock screen is required to allow in-process RealTimeCommunication related
            // background code to execute.
            if (!lockScreenAdded)
            {
                BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();
                Diag.DebugPrint("Lock screen status: " + status);

                switch (status)
                {
                    case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
                        // App is allowed to use RealTimeConnection  
                        // functionality even in low power mode.
                        lockScreenAdded = true;
                        break;
                    case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
                        // App is allowed to use RealTimeConnection  
                        // functionality but not in low power mode.
                        lockScreenAdded = true;
                        break;
                    case BackgroundAccessStatus.Denied:
                        Diag.DebugPrint("Lock screen status was denied.");
                        break;
                }
            }

            if (lockScreenAdded)
            {
                // Now, enable the client settings.
                ClientSettings.Visibility = Visibility.Visible;
                ConnectButton.Visibility = Visibility.Visible;
            }

            Diag.DebugPrint("Initializing client done");
            return;
        }
 public AppContext(CommunicationModule commInstance)
 {
     CommunicationInstance = commInstance;
     messageQueue          = new ConcurrentQueue <string>();
 }
Ejemplo n.º 4
0
 public AppContext(CommunicationModule commInstance)
 {
     CommunicationInstance = commInstance;
     messageQueue = new ConcurrentQueue<string>();
 }