我正在尝试在我的 C# 应用程序中使用 Recent 和 Frequent JumpLists。我正在使用 Windows API 代码包 v1.1 (http://code.msdn.microsoft.com/WindowsAPICodePack)。每次应用启动时我都会初始化 JumpList,每次在应用中打开项目时我都会将 AddRecent() 添加到 JumpList。
缺少某些东西,因为当您右键单击任务栏中的应用程序图标时,JumpLists 根本没有显示。我有一个文件只显示一次,仅此而已!
初始化:
private void InitializeJumpLists()
{
if (TaskbarManager.IsPlatformSupported)
{
JumpList recentJumpList = null;
JumpList frequentJumpList = null;
TaskbarManager.Instance.ApplicationId = Application.ProductName;
recentJumpList = JumpList.CreateJumpList();
recentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;
recentJumpList.Refresh();
frequentJumpList = JumpList.CreateJumpList();
frequentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Frequent;
frequentJumpList.Refresh();
}
}
打开项目:
private void OpenProject(string path, bool isFromRecentFilesList)
{
DialogResult result = ConfirmProjectClosing();
if (result == DialogResult.Yes)
Save();
else if (result == DialogResult.Cancel)
return;
using (new Wait())
{
//Code here opens the project, etc.
//Try to add the file to the Jump List.
if (TaskbarManager.IsPlatformSupported)
JumpList.AddToRecent(path);
//Code here finished up.
}
}
我错过了什么?
最佳答案
this page 发生了什么?与您遇到的问题密切相关?
关于c# - JumpLists 在 C# 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4572544/