JumpList.GetJumpList(Application) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Devuelve el JumpList objeto asociado a una aplicación.
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
Aplicación asociada a .JumpList
Devoluciones
Objeto JumpList asociado a la aplicación especificada.
Ejemplos
En el ejemplo siguiente se muestra cómo obtener el JumpList asociado a la aplicación actual.
JumpTask Se agrega a la JumpItems colección y se agrega a la categoría Recent. Se llama al método
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();
}
Comentarios
Puede llamar al GetJumpList método para obtener el JumpList objeto asociado actualmente a .Application El .NET Framework no requiere que sea el JumpList que se aplica actualmente al shell de Windows.