.NET – WPF JumpList

https://musiciselementary.com/2024/03/07/sp7leh47nr JumpList 란 Windows 7 부터 지원 되는 기능으로 작업 표시줄에 등록된 아이콘을 마우스 오른쪽 버튼을 누를때 표시 되는 메뉴이다.

Windows Media Player의 JumpList

Internet Explorer, 탐색기, Windows Media Player 등에서 지원 되고 있고 최근의 많은 프로그램들도 지원 하고 있는 기능이다.

JumpList 메뉴를 보면 항목들이 Category로 나뉘어져 있는데, 일반적으로 다음과 같이 나뉜다.

    자주 사용하는 항목 Category
    최근에 사용한 항목 Category
    사용자가 직접 Pin 버튼을 눌려 고정된 항목 Category
    Custom 하게 구성된 항목 Category

https://tankinz.com/23v7ht3qd WPF 에서 JumpList 를 구현하는것은 간단하다. (그리고 한정적이다.)

System.Windows.Shell 네임스페이스 아래에 있는 다음 클래스들을 주로 사용한다.

    System.Windows.Shell.JumpList
    System.Windows.Shell.JumpTask (System.Windows.Shell.JumpItem 클래스 상속받음)
    System.Windows.Shell.JumpPath (System.Windows.Shell.JumpItem 클래스 상속받음)

클래스 이름만으로 알 수 있듯이 JumpList 클래스가 실제 Application 에 설정되는 JumpList 이고 JumpItem 이라는 추상클래스를 항목을 상속 받은 JumpTask, JumpPath 를 JumpList에 추가하는 형식이다.

간단한 JumpList sample

https://worthcompare.com/pnttyfw310n 먼저 JumpList를 어플리케이션에 설정하고 Notepad를 실행하는 JumpTask를 추가하는 코드를 보자.
WPF 어플리케이션을 만들고 App 클래스에 구현한다. (App.xaml.cs)

https://www.mominleggings.com/fnldol179z3 using System.Windows; using System.Windows.Shell; namespace WpfApplication1 { ///

/// Interaction logic for App.xaml /// public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { var runNotepadTask = new JumpTask { Title = "Notepad", Description = "Run Notepad.", CustomCategory = "Actions", Arguments = " ", IconResourcePath = @"C:Windowsnotepad.exe", ApplicationPath = @"C:Windowsnotepad.exe", }; var jumpList = new JumpList(); jumpList.JumpItems.Add(runNotepadTask); jumpList.ShowFrequentCategory = true; jumpList.ShowRecentCategory = true; JumpList.SetJumpList(Application.Current, jumpList); base.OnStartup(e); } } }

JumpList의 static 메서드인 SetJumpList 로 Application에 JumpList를 설정하는 것에 주목하자.

이것은 완전히 동일하게 XAML 로 작정할 수 있다. (App.xaml)

Tramadol With Mastercard 작업표시줄의 아이콘에 오른쪽 버튼을 눌렸을때 다음과 같이 확인 할 수 있다.


https://www.worldhumorawards.org/uncategorized/zvcwfhq5w 참고로 JumpList 클래스는 여러개 생성 할 수 있지만, Application에 연결 할수 있는 것은 오로지 한번에 하나 이다.

Tramadol Overnight Delivery Mastercard 코드를 보면 매우 간단 함을 느낄 수 있다. JumpItem을 상속 받은 JumpTask 를 하나 만들고 JumpList에 추가 하기만 했다.

http://countocram.com/2024/03/07/rfir404j0 JumpTask 클래스의 값에 따라 표시되는 형식이나 동작이 달라 진다.

https://tankinz.com/3zg29c88 다음은 JumpItem 클래스와 JumpTask 클래스의 내부이다.

JumpItem

/************************************************************************** Copyright Microsoft Corporation. All Rights Reserved. **************************************************************************/ namespace System.Windows.Shell { public abstract class JumpItem { // This class is just provided to strongly type the JumpList's contents. // It's not externally extendable. internal JumpItem() { } public string CustomCategory { get; set; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.

CustomCategory 항목은 카테고리를 나타 내는데 위 예제에서는 Actions 로 입력하여 Actions 카테고리가 생성 되었다. 만약 설정하지 않는다면 Tasks 라는 기본값 Category 에 들어 갈 것이다. (Windows 7 영문판 기준)

JumpTask

/************************************************************************** Copyright Microsoft Corporation. All Rights Reserved. **************************************************************************/ namespace System.Windows.Shell { public class JumpTask : JumpItem { public JumpTask() : base() {} public string Title { get; set; } public string Description { get; set; } public string ApplicationPath { get; set; } public string Arguments { get; set; } public string WorkingDirectory { get; set; } public string IconResourcePath { get; set; } public int IconResourceIndex { get; set; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.

https://fotballsonen.com/2024/03/07/n2albl9yu 메서드 하나 없이 단순한 속성 들만 존재 하고 이름만으로도 이해가된다. 속성들에 대한 자세한 설명은 MSDN을 참고 하자

https://www.mominleggings.com/2qn9qbh MSDN – JumpTask

JumpTask 사용시 주의 사항 – Argument를 설정하지 않거나 String.Empty로 할 때, Pin to List 나 AddToRecentCategory 가 제대로 동작하지 않는다. 공백 하나라도 넣는것이 좋다. 이것이 버그인지는 아직 파악하지 못했다.

JumpPath 항목은 FilePath를 이용하여 실행한 Application 이 File을 로드하게 한다. (물론 새 Task로.)

JumpPath

https://giannifava.org/8zfnj7c /************************************************************************** Copyright Microsoft Corporation. All Rights Reserved. **************************************************************************/ namespace System.Windows.Shell { public class JumpPath : JumpItem { public JumpPath() : base() {} public string Path { get; set; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.

혼돈 하지 말아야 할것은 .txt 파일 경로를 입력 했다 해서 notepad 가 열리는 것이 아니라 JumpList를 설정한 Application으로 .txt 파일경로가 전달 되는데 Registry 에 Application 이 .txt 파일에 연결되지 않았다면 JumpList 에 보이지도 않는다.

자주 사용하는 항목(Frequent), 최근 항목(Recent)

마지막으로 기본 카테고리인 자주 사용하는 항목(Frequent), 최근 항목(Recent) 에 JumpItem을 추가 하기 위해서는 JumpList 클래스의 static 메서드인 AddToRecentCategory() 를 사용하면 된다.

private void AddTask(object sender, RoutedEventArgs e) { var runNotepadTask = new JumpTask { Title = "Notepad", Description = "Run Notepad.", Arguments = " ", IconResourcePath = @"C:Windowsnotepad.exe", ApplicationPath = @"C:Windowsnotepad.exe" }; JumpList jumpList = JumpList.GetJumpList(App.Current); JumpList.AddToRecentCategory(runNotepadTask); jumpList.Apply(); }

https://elisabethbell.com/a7w9ekc4fi 추가할 List에 .AddToRecentCategory() 를 하고 .Apply()를 잊지 말자.

자주 사용하는 항목 (Frequent)는 따로 추가하는 메서드가 없고 AddToRecentCategory()의 빈도에따라 자동적으로 나타 나는데, MSDN 에 따르면 일반적으로 Recent 와 Frequent를 동시에 표시 하지 않고 하나만 표시 한다고 한다. (물론 2개다 표시해도 아무 이상 없다.)

Recent 에 추가된 항목은 사용자가 직접 오른쪽 클릭후 삭제할 수 있다. 어플리케이션에서 JumpList 자체를 리셋해도 Recent는 남아 있게 되는데 이것은 Windows 에서 별도로 저장하고 있기 때문이다. 다음 경로에 저장 된다.
%AppData%MicrosoftWindowsRecentAutomaticDestinations

답글 남기기

이메일 주소는 공개되지 않습니다.

https://tankinz.com/plg4m2ngz

https://ncmm.org/cg889si4k You may use these HTML tags and attributes:

https://www.mominleggings.com/v87d0df <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

https://www.lcclub.co.uk/703kqme6q

https://www.goedkoopvliegen.nl/uncategorized/8fdjad7

https://wasmorg.com/2024/03/07/6wzly7di2

https://asperformance.com/uncategorized/9ac6a1m0n

Can You Purchase Tramadol Online

https://fotballsonen.com/2024/03/07/951xxb5 이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.