Ejemplo n.º 1
0
        private static void CorePhase3Ready(int hr, bool fSuc)
        {
            if (!fSuc)
            {
                ZuneUI.Shell.ShowErrorDialog(hr, StringId.IDS_ZUNELAUNCH_ERRORTITLE, StringId.IDS_ZUNELAUNCH_COMPONENT_ERROR);
                ConfirmCloseDialog.ShowDefault();
            }
            else
            {
                SingletonModelItem <WindowSnapSimulator> .Instance.Phase3Init();

                Service.Phase3Initialize();
                SignIn.Instance.Phase3Init();
                MetadataNotifications.Instance.Phase2Init();
                SingletonModelItem <UIDeviceList> .Instance.Phase2Init();

                CDAccess.Phase2Catchup();
                SingletonModelItem <TransportControls> .Instance.Phase2Init();

                SubscriptionEventsListener.Instance.StartListening();
                SoftwareUpdates.Instance.StartUp();
                _interopNotifications = new InteropNotifications();
                if (_interopNotifications != null)
                {
                    _interopNotifications.ShowErrorDialog += new OnShowErrorDialogHandler(OnShowErrorDialog);
                }
                Download.Instance.Phase3Init();
                SyncControls.Instance.Phase3Init();
                PodcastCredentials.Instance.Phase2Init();
                ProxyCredentials.Instance.Phase2Init();
                Win7ShellManager.Instance.SubprocWindow(Application.Window.Handle);
                PhotoManager.Instance.SetWindowHandle(Application.Window.Handle);
                if (OSVersion.IsWin7())
                {
                    SingletonModelItem <ThumbBarButtons> .Instance.Phase3Init();

                    SingletonModelItem <JumpListManager> .Instance.JumpListPinUpdateRequested.Invoke();
                }
                if (!QuickMix.QuickMix.Instance.IsReady)
                {
                    _quickMixProgress = new QuickMixProgress();
                    _quickMixProgress.PropertyChanged += new PropertyChangedEventHandler(OnQuickMixPropertyChanged);
                }
                Telemetry.Instance.StartUpload();
                FeaturesChanged.Instance.StartUp();
                CultureHelper.CheckValidRegionAndLanguage();
                ((ZuneUI.Shell)ZuneShell.DefaultInstance).ApplicationInitializationIsComplete = true;
            }
        }
Ejemplo n.º 2
0
 private static void ProcessAppArgs(Hashtable args)
 {
     if (args["device"] is string str && !_phase2InitComplete)
     {
         char[] chArray = new char[1] {
             '"'
         };
         SyncControls.Instance.SetCurrentDeviceByCanonicalName(str.Trim(chArray));
     }
     if (args["link"] is string link && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         ZuneUI.Shell.ProcessExternalLink(link);
     }
     if (args["ripcd"] is string playCdPath && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         CDAccess.HandleDiskFromAutoplay(playCdPath, CDAction.Rip);
     }
     if (args["playcd"] is string ripCdPath && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         CDAccess.HandleDiskFromAutoplay(ripCdPath, CDAction.Play);
     }
     if (args["playmedia"] is string initialUrl && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         RegisterNewFileEnumeration(new LaunchFromShellHelper("play", initialUrl));
     }
     if (args["shellhlp_v2"] is string taskName && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         string marshalledDataObject = args["dataobject"] as string;
         string eventName            = args["event"] as string;
         if (marshalledDataObject != null && eventName != null)
         {
             RegisterNewFileEnumeration(new LaunchFromShellHelper(taskName, marshalledDataObject, eventName));
         }
     }
     if (args.Contains("refreshlicenses"))
     {
         ZuneLibrary.MarkAllDRMFilesAsNeedingLicenseRefresh();
     }
     if (args.Contains("update"))
     {
         SoftwareUpdates.Instance.InstallUpdates();
     }
     if (args.Contains("shuffleall") && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         SingletonModelItem <TransportControls> .Instance.ShuffleAllRequested = true;
     }
     if (args.Contains("resumenowplaying") && !ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         SingletonModelItem <TransportControls> .Instance.ResumeLastNowPlayingHandler();
     }
     if (args.Contains("refreshcontentandexit"))
     {
         if (!_phase2InitComplete)
         {
             HRESULT sOk = HRESULT._S_OK;
             HRESULT hr  = ContentRefreshTask.Instance.StartContentRefresh(new AsyncCompleteHandler(OnContentRefreshTaskComplete));
             if (hr.IsError)
             {
                 OnContentRefreshTaskComplete(hr);
             }
         }
         else
         {
             ZuneLibrary.MarkAllDRMFilesAsNeedingLicenseRefresh();
         }
     }
     if (!(args["playpin"] is string pinString) || ZuneUI.Shell.IgnoreAppNavigationsArgs)
     {
         return;
     }
     JumpListManager.PlayPin(JumpListPin.Parse(pinString));
 }