Я пытаюсь использовать Недавние и Частые списки переходов в моем приложении C #. Я использую Windows API Codepack v1.1 (http://code.msdn.microsoft.com/WindowsAPICodePack). Я инициализирую JumpLists каждый раз при запуске приложения и добавляю AddRecent () в JumpList каждый раз, когда открываю проект в приложении.
Чего-то не хватает, потому что списки переходов просто не отображаются, если щелкнуть правой кнопкой мыши значок приложения на панели задач. У меня есть один файл, чтобы показать его один раз, но это все!
Инициализация:
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.
}
}
Чего мне не хватает?