Inheritance: ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgs
        public void Activate(CachedFileUpdaterActivatedEventArgs args)
        {
            // cache CachedFileUpdaterUI
            cachedFileUpdaterUI = args.CachedFileUpdaterUI;

            // Currently, the Desktop device family activates the app in the background. Other device families
            // use a background task activation. We need to handle both cases.
            //
            // We can check to see if there is UI on activation to determine which case we are in, because
            // we receive the FileUpdateRequest differently.
            //
            // If activated in the foreground (visible), then the FileUpdateRequest is passed explicitly as
            // part of the activation.
            //
            // If activated in the background (not visible), then we subscribe to the FileUpdateRequested
            // and UIRequest events. The FileUpdateRequest is received as part of the FileUpdatedRequested event,
            // and UIRequested is raised when user input is needed to resolve a conflict.

            bool isForegroundActivated = (cachedFileUpdaterUI.UIStatus == UIStatus.Visible);
            if (isForegroundActivated)
            {
                fileUpdateRequest = cachedFileUpdaterUI.UpdateRequest;
                fileUpdateRequestDeferral = cachedFileUpdaterUI.GetDeferral();
            }
            else
            {
                cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;
                cachedFileUpdaterUI.UIRequested += CachedFileUpdaterUI_UIRequested;
            }

            switch (cachedFileUpdaterUI.UpdateTarget)
            {
                case CachedFileTarget.Local:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Get latest version", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Local) } };
                    break;
                case CachedFileTarget.Remote:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Remote file update", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Remote) } };
                    break;
            }

            if (isForegroundActivated)
            {
                Window.Current.Content = this;
                this.OnNavigatedTo(null);
                Window.Current.Activate();
            }
        }
        public void Activate(CachedFileUpdaterActivatedEventArgs args)
        {
            // cache CachedFileUpdaterUI
            cachedFileUpdaterUI = args.CachedFileUpdaterUI;

            cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;
            cachedFileUpdaterUI.UIRequested += CachedFileUpdaterUI_UIRequested;

            switch (cachedFileUpdaterUI.UpdateTarget)
            {
                case CachedFileTarget.Local:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Get latest version", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Local) } };
                    break;
                case CachedFileTarget.Remote:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Remote file update", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Remote) } };
                    break;
            }

            Window.Current.Activate();
        }
Esempio n. 3
0
 protected override async void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args) { await InternalActivatedAsync(args); }
Esempio n. 4
0
 protected override void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args)
 {
     var CachedFileUpdaterPage = new SDKTemplate.CachedFileUpdaterPage();
     CachedFileUpdaterPage.Activate(args);
 }
Esempio n. 5
0
 protected override void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args)
 {
     base.OnCachedFileUpdaterActivated(args);
     Activate(args);
 }
 protected virtual Task OnCachedFileUpdaterStartAsync(CachedFileUpdaterActivatedEventArgs args, AppStartInfo info)
 {
     return Task.FromResult<object>(null);
 }
 protected override sealed async void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args)
 {
     AppStartInfo info = AppStartInfo.Default;
     await this.OnPreStartAsync(args, info);
     await this.OnCachedFileUpdaterStartAsync(args, info);
     this.InternalStartAsync(args, info);
 }
 protected sealed override async void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args) { await Activated(args); }