Compartilhar via


JumpList.GetJumpList(Application) Método

Definição

Retorna o objeto JumpList associado a um aplicativo.

public:
 static System::Windows::Shell::JumpList ^ GetJumpList(System::Windows::Application ^ application);
public static System.Windows.Shell.JumpList GetJumpList (System.Windows.Application application);
static member GetJumpList : System.Windows.Application -> System.Windows.Shell.JumpList
Public Shared Function GetJumpList (application As Application) As JumpList

Parâmetros

application
Application

O aplicativo associado ao JumpList.

Retornos

JumpList

O objeto JumpList associado ao aplicativo especificado.

Exemplos

O exemplo a seguir mostra como obter o JumpList associado ao aplicativo atual. Um JumpTask é adicionado à JumpItems coleção e adicionado à categoria Recentes . O Apply método é chamado para aplicar o shell de Windows atualizadoJumpList. Este exemplo faz parte de um exemplo maior disponível na visão geral da JumpList classe.

private void AddTask(object sender, RoutedEventArgs e)
{
    // Configure a new JumpTask.
    JumpTask jumpTask1 = new JumpTask();
    // Get the path to Calculator and set the JumpTask properties.
    jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.Title = "Calculator";
    jumpTask1.Description = "Open Calculator.";
    jumpTask1.CustomCategory = "User Added Tasks";
    // Get the JumpList from the application and update it.
    JumpList jumpList1 = JumpList.GetJumpList(App.Current);
    jumpList1.JumpItems.Add(jumpTask1);
    JumpList.AddToRecentCategory(jumpTask1);
    jumpList1.Apply();
}

Comentários

Você pode chamar o GetJumpList método para obter o JumpList associado atualmente a um Application. O .NET Framework não exige que este seja o JumpList que é aplicado atualmente ao shell Windows.

Aplica-se a