我正在尝试在C#应用程序中使用“最近和经常使用的跳转列表”。我正在使用Windows API Codepack v1.1(http://code.msdn.microsoft.com/WindowsAPICodePack)。每次启动应用程序时,我都会初始化JumpLists;每次在应用程序中打开项目时,我都会将JumpRecent()添加到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与您所看到的问题有何关系?