Пример #1
0
        protected override void OnViewLoaded(object view)
        {
            base.OnViewLoaded(view);

            IntPtr     windowHandle = new WindowInteropHelper(playerWindow).Handle;
            HwndSource source       = HwndSource.FromHwnd(windowHandle);

            source.AddHook(new HwndSourceHook(WndProc));

            this.DXCanvas.StopRendering();

            shellView.BufferingStatus.Visibility = Visibility.Collapsed;

            ShowStartupUI();

            if (!string.IsNullOrWhiteSpace(FileFromArgs))
            {
                LoggerManager.Info($"Opening URI from command line arguments: {FileFromArgs}");
                OpenURI(FileFromArgs);
            }

            Logic.Instance.CheckForUpdate();
#if FEATURE_BROWSER_PLUGINS
            BrowserPluginManagement.CheckForBrowsers();
#endif
            Logic.Instance.stats.TrackScreen("Start screen");
            Logic.Instance.stats.TrackEvent("Application events", "Init", "Player launched");

            //LegacyTest();

#if FEATURE_REMOTE_CONTROL
            if (Logic.Instance.settings.EnableRemoteControl)
            {
                EnableRemoteControl();
            }
#endif
            if (Logic.Instance.settings.UseBlackBackground)
            {
                shellView.mainGrid.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Black);
            }
            if (Logic.Instance.settings.DisableUI)
            {
                shellView.controlBar.Visibility = Visibility.Collapsed;
                shellView.TopBar.Visibility     = Visibility.Collapsed;
                shellView._OpenUrl.Visibility   = Visibility.Collapsed;
                shellView._OpenFile.Visibility  = Visibility.Collapsed;
            }

            Features.ListUpdated += LicenseUpdated;
#if FEATURE_LICENSE_NINJA
            licensingConnector.LicenseCheck();
#else
            // set hardcoded basic no-license-required features
            Features.SetBasicFeatures();
#endif

            InputDevices.NavigatorInputDevice.TryInit(windowHandle);

            var motdBridge = new MOTDBridge();
            motd = new MOTDClient("https://download.bivrost360.com/player-desktop/?action=", motdBridge);

            var currentVersion = motdBridge.Version;
            var prevVersion    = Logic.Instance.settings.LastStoredPlayerVersion;
            if (currentVersion != prevVersion)             //< first install or an update?
            {
                motd.RequestUpgradeNotice(prevVersion);
                Logic.Instance.settings.LastStoredPlayerVersion = currentVersion;
                Logic.Instance.settings.Save();
            }
            else
            {
                motd.RequestMOTD();
            }
        }