JumpList 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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 링크와 1 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 사용자 환경 상호 작용 지침의 Taskbar 섹션을 참조하세요.
JumpList 클래스는 Windows 7 작업 표시줄의 점프 목록 기능에 대한 관리되는 래퍼를 제공하고 Windows 셸에 전달된 데이터를 관리합니다. JumpList 클래스에서 노출하는 기능은 Windows 7 이전 버전의 Windows 사용할 수 없습니다. JumpList 클래스를 사용하는 애플리케이션은 다른 버전의 Windows 실행되지만 점프 목록을 사용할 수 없습니다. Windows 셸 및 네이티브 점프 목록 API에 대한 자세한 내용은 태스크바 확장을 참조하세요.
다음 그림에서는 Tasks 및 Frequent 범주의 항목과 함께 Windows Media Player 점프 목록을 보여 줍니다.
Windows Media Player 점프 목록
점프 목록 구성
점프 목록에는 두 가지 유형의 항목이 JumpTask 포함될 수 있습니다 JumpPath. A JumpTask 는 프로그램에 대한 링크이며 JumpPath 파일에 대한 링크입니다. 지정하지 않은 항목을 만들어 점프 목록에서 항목을 시각적으로 JumpTaskTitleCustomCategory 구분할 수 있습니다. 이 빈 JumpTask 항목은 점프 목록에 가로줄로 표시됩니다.
메모
애플리케이션에 JumpPath 지정된 파일의 형식이 등록되지 않은 경우 파일은 점프 목록에 표시되지 않습니다. 예를 들어 .txt 파일에 해당 점을 추가하는 JumpPath 경우 .txt 파일을 처리하도록 애플리케이션을 등록해야 합니다. 자세한 내용은 파일 연결 소개를 참조하세요.
점프 항목은 .의 범주에 JumpList배치됩니다. 기본적으로 작업JumpItem 범주에 A가 표시됩니다. 또는 에 대한 JumpItem값을 CustomCategory 지정할 수 있습니다.
표준 최근 및 자주 사용하는 범주를 설정 ShowRecentCategoryShowFrequentCategory 하여 표시 JumpList 할지 여부를 지정할 수 있습니다. 이러한 범주의 내용은 Windows 셸에서 관리됩니다. 이러한 범주는 동일한 데이터를 대부분 포함할 수 있으므로 일반적으로 둘 다 아니라 둘 다에 하나 또는 다른 데이터를 표시합니다 JumpList. Windows 공통 파일 대화 상자를 통해 열거나 파일 형식 연결을 통해 애플리케이션을 여는 데 사용되는 경우 최근 항목을 자동으로 관리합니다. 점프 목록을 통해 항목에 액세스하면 Windows 셸에 AddToRecentCategory 메서드를 호출하여 항목을 Recent 범주에 추가할 수 있습니다.
Windows 셸에 점프 목록 적용
셸의 점프 목록에 직접 액세스하거나 해당 내용을 클래스로 JumpList 읽을 수 없습니다. 대신 JumpList 클래스는 작업할 수 있는 점프 목록의 표현을 제공하고 Windows 셸에 적용합니다. 일반적으로 애플리케이션을 JumpList 처음 실행할 때 한 번 만들고 설정합니다. 그러나 런타임에 수정하거나 바꿀 JumpList 수 있습니다.
JumpList 속성을 설정한 경우 작업 표시줄 점프 목록에 내용이 표시되기 전에 JumpList Windows 셸에 적용해야 합니다. 이 작업은 XAML 또는 메서드 호출에서 애플리케이션에 처음 연결되면 SetJumpList 자동으로 JumpList 수행됩니다. 런타임에 JumpList 내용을 수정하는 경우 Apply 메서드를 호출하여 현재 내용을 Windows 셸에 적용해야 합니다.
XAML에서 점프 목록 설정
A JumpList 는 개체에 Application 자동으로 연결되지 않습니다. 연결된 속성 구문을 사용하여 XAML의 개체에 연결 JumpListApplication 합니다. 클래스는 JumpList XAML 선언을 ISupportInitialize 지원하는 인터페이스를 구현합니다 JumpList. JumpList XAML에서 선언되고 현재 Application 연결된 경우 JumpList 초기화될 때 Windows 셸에 자동으로 적용됩니다.
코드에서 점프 목록 설정 및 수정
정적 SetJumpList 메서드를 JumpList 호출하여 Application 코드에서 개체에 연결합니다. 또한 Windows 셸에 JumpList 적용됩니다.
런타임에 JumpList 수정하려면 메서드를 GetJumpList 호출하여 JumpList 현재 연결된 메서드를 Application가져옵니다. JumpList 속성을 수정한 후에는 Apply 메서드를 호출하여 변경 내용을 Windows 셸에 적용해야 합니다.
메모
일반적으로 Application 연결되고 Windows 셸에 적용되는 JumpList 하나를 만듭니다. 그러나 여러 JumpList 개체를 만들 수 있습니다. 한 번에 하나의 JumpList Windows 셸에 적용할 수 있으며 한 번에 하나의 JumpListApplication 연결할 수 있습니다. .NET Framework에서는 이러한 JumpList 동일할 필요가 없습니다.
메모
이 클래스에는 모든 멤버에 적용되는 클래스 수준의 링크 요청이 포함되어 있습니다. 직접 호출자에게 완전 신뢰 권한이 없는 경우 A SecurityException 가 throw됩니다. 보안 요구 사항에 대한 자세한 내용은 링크 요구를 참조하세요.
생성자
| Name | Description |
|---|---|
| JumpList() |
JumpList 클래스의 새 인스턴스를 초기화합니다. |
| JumpList(IEnumerable<JumpItem>, Boolean, Boolean) |
지정된 매개 변수를 사용하여 클래스의 JumpList 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| JumpItems |
점프 목록에 표시되는 개체의 JumpItem 컬렉션을 가져옵니다. |
| ShowFrequentCategory |
점프 목록에 자주 사용되는 항목이 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다. |
| ShowRecentCategory |
점프 목록에 최근에 사용한 항목이 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| 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) |
이벤트
| Name | Description |
|---|---|
| JumpItemsRejected |
점프 항목이 Windows 셸에 의해 점프 목록에 성공적으로 추가되지 않은 경우에 발생합니다. |
| JumpItemsRemovedByUser |
점프 목록의 이전 점프 항목이 사용자가 목록에서 제거할 때 발생합니다. |