Share via


InstallationManager.FindPackagesForCurrentPublisher Metodo

Definizione

Restituisce tutti i pacchetti dell'app con lo stesso ID editore dell'app che chiama questo metodo.

public:
 static IIterable<Package ^> ^ FindPackagesForCurrentPublisher();
 static IIterable<Package> FindPackagesForCurrentPublisher();
public static IEnumerable<Package> FindPackagesForCurrentPublisher();
function findPackagesForCurrentPublisher()
Public Shared Function FindPackagesForCurrentPublisher () As IEnumerable(Of Package)

Restituisce

Elenco di pacchetti di app con lo stesso ID editore dell'app che chiama questo metodo.

Esempio

using Windows.ApplicationModel;
using Windows.Phone.Management.Deployment;

void DisplayApplicationInfo(string ProductId)
{

    IEnumerable<Package> packages = InstallationManager.FindPackagesForCurrentPublisher();

    // Loop over all installed applications looking for the specified ProductId 
    // (not the most efficient way to search, but a simple way to show how to use   
    // the functionality. 
    foreach (Package package in packages)
    {
        if (package.Id.ProductId.ToString().ToLower()== ProductId.ToLower())
        {
            // Dislay the title info in the ApplicationTitle textlock.
            ApplicationTitle.Text = package.Id.Name;

            // Retrieve the icon image by getting its DSS Token.
            string token = package.GetThumbnailToken();

            // Do something with image token.

        }
    }
}

È anche possibile usare questo metodo per verificare se altre app dall'ID editore sono installate su un telefono. Se sono installati, è possibile avviarli. Per dimostrare, l'esempio seguente enumera tutte le app per l'ID editore corrente e avvia la prima app nell'enumerazione (a meno che l'app non sia l'app corrente).

IEnumerable<Package> apps = Windows.Phone.Management.Deployment.InstallationManager.FindPackagesForCurrentPublisher();
apps.First().Launch(string.Empty);

Commenti

Questo metodo restituisce tutte le applicazioni associate all'ID editore dell'app chiamante. ad esempio:

  • App precaricate sul telefono.
  • App installate dall'utente.
  • App attualmente archiviate nella scheda SD del telefono.
  • App aziendali.

Si applica a