JumpList.GetJumpList(Application) Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Retorna o JumpList objeto 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
O JumpList objeto associado ao aplicativo especificado.
Exemplos
O exemplo a seguir mostra como obter o JumpList aplicativo atual associado. Um JumpTask é adicionado à JumpItems coleção e adicionado à categoria Recent . O método Apply é chamado para aplicar o JumpList atualizado ao shell Windows. 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 atualmente associado a um Application. O .NET Framework não exige que este seja o JumpList que atualmente é aplicado ao shell Windows.