JumpList 클래스

정의

Windows 7 작업 표시줄 단추에 메뉴로 표시되는 항목 및 작업의 목록을 나타냅니다.

public ref class JumpList sealed : System::ComponentModel::ISupportInitialize
[System.Windows.Markup.ContentProperty("JumpItems")]
public sealed class JumpList : System.ComponentModel.ISupportInitialize
[System.Windows.Markup.ContentProperty("JumpItems")]
[System.Security.SecurityCritical]
public sealed class JumpList : System.ComponentModel.ISupportInitialize
[<System.Windows.Markup.ContentProperty("JumpItems")>]
type JumpList = class
    interface ISupportInitialize
[<System.Windows.Markup.ContentProperty("JumpItems")>]
[<System.Security.SecurityCritical>]
type JumpList = class
    interface ISupportInitialize
Public NotInheritable Class JumpList
Implements ISupportInitialize
상속
JumpList
특성
구현

예제

다음 예제에서는 점프 목록을 사용 하 여 애플리케이션을 보여 줍니다. 애플리케이션에 현재 점프 목록에 작업을 추가, 점프 목록에서의 내용을 지울 및 새 점프 목록 애플리케이션에 적용할 수 있도록 하는 세 가지 단추가 있습니다.

다음 예제에서는 선언 하는 방법을 보여 줍니다는 JumpList 태그에서입니다. 에는 JumpList 두 개의 JumpTask 링크와 하나의 JumpPath가 포함됩니다. 적용 된 JumpPath 셸에.txt 파일 이름 확장명을 처리 하는 애플리케이션을 등록 하지 않은 경우 실패 합니다.

<Application x:Class="JumpListSample.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <JumpList.JumpList>
        <JumpList ShowRecentCategory="True"
                  ShowFrequentCategory="True"
                  JumpItemsRejected="JumpList_JumpItemsRejected"
                  JumpItemsRemovedByUser="JumpList_JumpItemsRemovedByUser">
            <JumpTask Title="Notepad" 
                      Description="Open Notepad." 
                      ApplicationPath="C:\Windows\notepad.exe"
                      IconResourcePath="C:\Windows\notepad.exe"/>
            <JumpTask Title="Read Me" 
                      Description="Open readme.txt in Notepad." 
                      ApplicationPath="C:\Windows\notepad.exe"
                      IconResourcePath="C:\Windows\System32\imageres.dll"
                      IconResourceIndex="14"
                      WorkingDirectory="C:\Users\Public\Documents"
                      Arguments="readme.txt"/>
            <JumpPath Path="C:\Users\Public\Documents\readme.txt" />
        </JumpList>
    </JumpList.JumpList>
</Application>

다음 예제에서는 에 대한 App.xaml코드 숨김 페이지를 보여줍니다. 이 코드는 및 JumpItemsRemovedByUser 이벤트를 처리합니다JumpItemsRejected.

using System.Text;
using System.Windows;
using System.Windows.Shell;

namespace JumpListSample
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void JumpList_JumpItemsRejected(object sender, System.Windows.Shell.JumpItemsRejectedEventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0} Jump Items Rejected:\n", e.RejectionReasons.Count);
            for (int i = 0; i < e.RejectionReasons.Count; ++i)
            {
                if (e.RejectedItems[i].GetType() == typeof(JumpPath))
                    sb.AppendFormat("Reason: {0}\tItem: {1}\n", e.RejectionReasons[i], ((JumpPath)e.RejectedItems[i]).Path);
                else
                    sb.AppendFormat("Reason: {0}\tItem: {1}\n", e.RejectionReasons[i], ((JumpTask)e.RejectedItems[i]).ApplicationPath);
            }

            MessageBox.Show(sb.ToString());
        }

        private void JumpList_JumpItemsRemovedByUser(object sender, System.Windows.Shell.JumpItemsRemovedEventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0} Jump Items Removed by the user:\n", e.RemovedItems.Count);
            for (int i = 0; i < e.RemovedItems.Count; ++i)
            {
                sb.AppendFormat("{0}\n", e.RemovedItems[i]);
            }

            MessageBox.Show(sb.ToString());
        }
    }
}

다음 예제에서는 애플리케이션 사용자 인터페이스를 만드는 데 태그를 보여 줍니다.

<Window x:Class="JumpListSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Jump List Sample" Height="240" Width="500">
    <Window.Resources>
        <Style TargetType="Button">
            <Setter Property="Width" Value="200" />
            <Setter Property="Margin" Value="5" />
        </Style>
    </Window.Resources>
    <Grid>
        <StackPanel>
            <Button Content="Add Task to JumpList" Click="AddTask" />
            <Button Content="Clear Jump List" Click="ClearJumpList"/>
            <Button Content="Set New Jump List" Click="SetNewJumpList" />
        </StackPanel>
    </Grid>
</Window>

다음 예제에서는 에 대한 MainWindow.xaml코드 숨김 페이지를 보여줍니다. 이 코드는 절차 코드에서 을 JumpList 수정, 지우기 및 만드는 방법을 보여 줍니다. 새 점프 목록, 정적 SetJumpList 메서드는 연결할를 JumpList 현재 애플리케이션을 사용 하 여 적용 하 고는 JumpList Windows 셸에.

using System;
using System.IO;
using System.Windows;
using System.Windows.Shell;

namespace JumpListSample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        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();
        }
        private void ClearJumpList(object sender, RoutedEventArgs e)
        {
            JumpList jumpList1 = JumpList.GetJumpList(App.Current);
            jumpList1.JumpItems.Clear();
            jumpList1.Apply();
        }
        private void SetNewJumpList(object sender, RoutedEventArgs e)
        {
            //Configure a new JumpTask
            JumpTask jumpTask1 = new JumpTask();
            // Get the path to WordPad and set the JumpTask properties.
            jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "write.exe");
            jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "write.exe");
            jumpTask1.Title = "WordPad";
            jumpTask1.Description = "Open WordPad.";
            jumpTask1.CustomCategory = "Jump List 2";
            // Create and set the new JumpList.
            JumpList jumpList2 = new JumpList();
            jumpList2.JumpItems.Add(jumpTask1);
            JumpList.SetJumpList(App.Current, jumpList2);
        }
    }
}

설명

Windows 7 작업 표시줄은 점프 목록을 사용하여 작업 표시줄 단추에서 직접 프로그램을 시작하는 향상된 기능을 제공합니다. 점프 목록은 Windows 7 시작 메뉴에서도 사용됩니다. 작업 표시줄 단추를 마우스 오른쪽 단추로 클릭하거나 시작 메뉴에서 프로그램 옆에 있는 화살표를 클릭하여 점프 목록에 액세스합니다. 점프 목록에 대한 자세한 내용은 Windows 사용자 환경 상호 작용 지침의 작업 표시줄 섹션을 참조하세요.

클래스는 JumpList Windows 7 작업 표시줄에서 점프 목록 기능에 대한 관리되는 래퍼를 제공하고 Windows 셸에 전달된 데이터를 관리합니다. 클래스에서 노출하는 JumpList 기능은 Windows 7 이전 버전의 Windows에서 사용할 수 없습니다. 클래스를 JumpList 사용하는 애플리케이션은 다른 버전의 Windows에서 실행되지만 점프 목록을 사용할 수 없습니다. Windows 셸 및 네이티브 점프 목록 API에 대한 자세한 내용은 작업 표시줄 확장을 참조하세요.

다음 그림에서는 작업도 범주에 항목이 있는 Windows 미디어 플레이어 대한 점프 목록을 보여 줍니다.

점프 목록 Windows 미디어 플레이어
Windows Media Player 점프 목록

점프 목록 구성

점프 목록에는 및 의 두 가지 유형의 항목이 JumpTaskJumpPath포함될 수 있습니다. 는 JumpTask 프로그램에 대한 링크이고 는 JumpPath 파일에 대한 링크입니다. 만들어 점프 목록에서 항목을 시각적으로 구분할 수 있습니다는 JumpTask 없는 TitleCustomCategory 지정 합니다. 이 빈 JumpTask 점프 목록에 가로 선으로 표시 됩니다.

참고

파일의 형식을 지정 하는 경우는 JumpPath 파일 점프 목록에 나타나지 것입니다 애플리케이션에 등록 되지 않았습니다. 예를 들어, 추가 하는 경우는 JumpPath .txt 파일을 가리키는,.txt 파일을 처리 하려면 애플리케이션을 등록 해야 합니다. 자세한 내용은 파일 연결 소개를 참조하세요.

점프 항목은 의 범주에 JumpList배치됩니다. 기본적으로 는 JumpItem작업 범주에 표시됩니다. 또는 에 대해 JumpItemCustomCategory 지정할 수 있습니다.

ShowFrequentCategory 속성을 설정 ShowRecentCategory 하여 표준 최근자주 사용하는 범주가 에 JumpList 표시되는지 여부를 지정할 수 있습니다. 이러한 범주의 내용은 Windows 셸에서 관리됩니다. 이러한 범주는 동일한 데이터를 대부분 포함할 수 있으므로 일반적으로 둘 다 아니라 에 하나 또는 다른 데이터를 표시합니다 JumpList. Windows는 공통 파일 대화 상자를 통해 열거나 파일 형식 연결을 통해 애플리케이션을 여는 데 사용되는 경우 최근 항목을 자동으로 관리합니다. 점프 목록을 통해 항목에 액세스하는 경우 메서드를 호출 AddToRecentCategory 하여 Windows 셸에 항목을 최근 범주에 추가하도록 알릴 수 있습니다.

Windows 셸에 점프 목록 적용

셸의 점프 목록에 직접 액세스하거나 해당 내용을 클래스로 JumpList 읽을 수 없습니다. 대신 클래스는 JumpList 작업할 수 있는 점프 목록의 표현을 제공하고 Windows 셸에 적용합니다. 일반적으로 만든를 JumpList 애플리케이션을 처음 실행할 때 한 번 설정 합니다. 그러나 런타임에 를 JumpList 수정하거나 바꿀 수 있습니다.

속성을 설정한 경우 해당 내용이 JumpList 작업 표시줄 점프 목록에 표시되기 전에 을 Windows 셸에 적용 JumpList 해야 합니다. 이 되 면 자동으로 수행 합니다 JumpList XAML 또는 호출에서 애플리케이션에 처음 연결을 SetJumpList 메서드. 런타임에 의 JumpList 콘텐츠를 수정하는 경우 메서드를 Apply 호출하여 현재 내용을 Windows 셸에 적용해야 합니다.

XAML에서 점프 목록 설정

JumpList 개체에 Application 자동으로 연결되지 않습니다. 연결된 속성 구문을 사용하여 를 XAML의 개체에 연결 JumpListApplication 합니다. 클래스는 JumpList 인터페이스를 ISupportInitialize 구현하여 의 XAML 선언을 지원합니다 JumpList. JumpList 가 XAML에서 선언되고 현재 Application에 연결된 경우 가 초기화될 때 Windows 셸에 JumpList 자동으로 적용됩니다.

코드에서 점프 목록 설정 및 수정

정적 SetJumpList 메서드를 Application 호출하여 코드의 개체에 를 연결 JumpList 합니다. 이는 Windows 셸에도 적용됩니다 JumpList .

런타임에 를 JumpList 수정하려면 메서드를 GetJumpList 호출하여 현재 에 연결된 Application를 가져옵니다JumpList. 의 속성을 수정한 후에는 메서드를 JumpListApply 호출하여 Windows 셸에 변경 내용을 적용해야 합니다.

참고

일반적으로 에 연결되고 Windows 셸에 Application 적용되는 항목을 JumpList 만듭니다. 그러나 여러 JumpList 개체를 만들 수 있습니다. 한 번에 하나 JumpList 만 Windows 셸에 적용할 수 있으며 한 번에 하나 JumpList 만 에 Application연결할 수 있습니다. .NET Framework 동일한 JumpList을 요구하지 않습니다.

참고

이 클래스는 모든 멤버에 적용 되는 클래스 수준에서 링크 요청을 포함 합니다. SecurityException 직접 실행 호출자에 full trust 권한이 없는 경우 throw 됩니다. 보안 요구 사항에 대한 자세한 내용은 링크 요청 및상속 요구를 참조하세요.

생성자

JumpList()

JumpList 클래스의 새 인스턴스를 초기화합니다.

JumpList(IEnumerable<JumpItem>, Boolean, Boolean)

지정된 매개 변수를 사용하여 JumpList 클래스의 새 인스턴스를 초기화합니다.

속성

JumpItems

점프 목록에 표시되는 JumpItem 개체의 컬렉션을 가져옵니다.

ShowFrequentCategory

점프 목록에 자주 사용되는 항목이 표시되는지 여부를 나타내는 값을 가져옵니다.

ShowRecentCategory

점프 목록에 최근에 사용한 항목이 표시되는지 여부를 나타내는 값을 가져옵니다.

메서드

AddToRecentCategory(JumpPath)

점프 목록의 최근에 사용한 항목 범주에 지정된 점프 경로를 추가합니다.

AddToRecentCategory(JumpTask)

점프 목록의 최근에 사용한 항목 범주에 지정된 점프 작업을 추가합니다.

AddToRecentCategory(String)

점프 목록의 최근에 사용한 항목 범주에 지정된 항목 경로를 추가합니다.

Apply()

JumpList의 현재 상태를 Windows 셸에 보냅니다.

BeginInit()

JumpList 초기화가 시작되었음을 나타냅니다.

EndInit()

JumpList 초기화가 끝났음을 나타냅니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetJumpList(Application)

애플리케이션과 연결된 JumpList 개체를 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
SetJumpList(Application, JumpList)

애플리케이션과 연결된 JumpList 개체를 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

이벤트

JumpItemsRejected

Windows 셸에서 점프 항목을 점프 목록에 추가하지 못한 경우 발생합니다.

JumpItemsRemovedByUser

사용자가 점프 목록의 기존 점프 항목을 목록에서 제거할 때 발생합니다.

적용 대상