Example #1
0
 private void GuidanceVideoWindow_IsVisibleChanged(
     object _1,
     DependencyPropertyChangedEventArgs eventArgs)
 {
     if (this.IsVisible)
     {
         ClientStats.SendKeyMappingUIStatsAsync("video_clicked", KMManager.sPackageName, KMManager.sVideoMode.ToString());
         this.mBrowser = new BrowserControl();
         this.mBrowser.InitBaseControl(BlueStacksUIUtils.GetVideoTutorialUrl(KMManager.sPackageName, KMManager.sVideoMode.ToString().ToLower(CultureInfo.InvariantCulture), this.ParentWindow?.SelectedConfig?.SelectedControlScheme?.Name), 0.0f);
         this.mBrowser.ParentWindow = this.ParentWindow;
         this.mBrowser.Visibility   = Visibility.Visible;
         this.mBrowserGrid.Children.Add((UIElement)this.mBrowser);
     }
     try
     {
         if ((bool)eventArgs.NewValue)
         {
             HTTPUtils.SendRequestToEngineAsync("mute", new Dictionary <string, string>()
             {
                 ["explicit"] = "False"
             }, this.ParentWindow.mVmName, 0, (Dictionary <string, string>)null, false, 1, 0, "bgp");
             this.ParentWindow.mCommonHandler.OnVolumeMuted(true);
         }
         else
         {
             if (this.ParentWindow.IsMuted)
             {
                 return;
             }
             HTTPUtils.SendRequestToEngineAsync("unmute", (Dictionary <string, string>)null, this.ParentWindow.mVmName, 0, (Dictionary <string, string>)null, false, 1, 0, "bgp");
             this.ParentWindow.mCommonHandler.OnVolumeMuted(false);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Failed to send mute to frontend. Ex: " + ex.Message);
     }
 }