Esempio n. 1
0
 /// <summary>
 /// The status of a package has changed (it could be a licensing issue, the package was on USB and has been removed removed, etc)
 /// Unload extensions if a package went offline or is otherwise no longer available
 /// </summary>
 /// <param name="sender">The catalog that the extensions belong to</param>
 /// <param name="args">Contains the package that has changed status</param>
 private async void Catalog_PackageStatusChanged(AppExtensionCatalog sender, AppExtensionPackageStatusChangedEventArgs args)
 {
     if (!args.Package.Status.VerifyIsOK()) // If the package isn't ok, unload its extensions
     {
         // if it's offline, unload its extensions
         if (args.Package.Status.PackageOffline)
         {
             await UnloadExtensions(args.Package);
         }
         else if (args.Package.Status.Servicing || args.Package.Status.DeploymentInProgress)
         {
             // if the package is being serviced or deployed, ignore the status events
         }
         else
         {
             // Deal with an invalid or tampered with package, or other issue, by removing the extensions
             // Adding a UI glyph to the affected extensions could be a good user experience if you wish
             await RemoveExtensions(args.Package);
         }
     }
     else // The package is now OK--attempt to load its extensions
     {
         await LoadExtensions(args.Package);
     }
 }
        // package status has changed, could be invalid, licensing issue, app was on USB and removed, etc
        private async void Catalog_PackageStatusChanged(AppExtensionCatalog sender, AppExtensionPackageStatusChangedEventArgs args)
        {
            // get package status
            if (!(args.Package.Status.VerifyIsOK()))
            {
                // if it's offline unload only
                if (args.Package.Status.PackageOffline)
                {
                    await UnloadExtensions(args.Package);
                }

                // package is being serviced or deployed
                else if (args.Package.Status.Servicing || args.Package.Status.DeploymentInProgress)
                {
                    // ignore these package status events
                }

                // package is tampered or invalid or some other issue
                // glyphing the extensions would be a good user experience
                else
                {
                    await RemoveExtensions(args.Package);
                }
            }
            // if package is now OK, attempt to load the extensions
            else
            {
                // try to load any extensions associated with this package
                await LoadExtensions(args.Package);
            }
        }
Esempio n. 3
0
        private async void _catalog_PackageStatusChanged(AppExtensionCatalog sender, AppExtensionPackageStatusChangedEventArgs args)
        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
            {
                ExtensionList.Clear();
            });

            await FindAllExtensions();
        }
 public AppExtensionPackageStatusChangedEventArgsWrapper(AppExtensionPackageStatusChangedEventArgs args)
 {
     _args = args;
 }
 private void _catalog_OnPackageStatusChanged(AppExtensionCatalog sender, AppExtensionPackageStatusChangedEventArgs args)
 {
     RefreshOnDispatcherThread();
 }
Esempio n. 6
0
        // package status has changed, could be invalid, licensing issue, app was on USB and removed, etc
        private async void Catalog_PackageStatusChanged(AppExtensionCatalog sender, AppExtensionPackageStatusChangedEventArgs args)
        {
            // get package status
            if (!(args.Package.Status.VerifyIsOK()))
            {
                // if it's offline unload only
                if (args.Package.Status.PackageOffline) await UnloadUWPExtensions(args.Package);

                // package is being serviced or deployed
                else if (args.Package.Status.Servicing || args.Package.Status.DeploymentInProgress)
                {
                    // ignore these package status events
                }

                // package is tampered or invalid or some other issue, remove the extensions
                else
                {
                    await RemoveUWPExtensions(args.Package);
                }

            }
            // if package is now OK, attempt to load the extensions
            else
            {
                // try to load any extensions associated with this package
                await LoadUWPExtensions(args.Package);
            }
        }