public void Dispose() { if (communicationModule != null) { communicationModule.Dispose(); communicationModule = null; } }
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>(); }
public AppContext(CommunicationModule commInstance) { CommunicationInstance = commInstance; messageQueue = new ConcurrentQueue<string>(); }