微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

跳转列表不适用于C#App

我正在尝试在我的C#应用​​程序中使用Recent和Frequent JumpLists.我正在使用Windows API Codepack v1.1(http://code.msdn.microsoft.com/WindowsAPICodePack).我每次应用程序启动时都会初始化JumpLists,每次在应用程序中打开项目时,我都会将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与您所看到的问题有什么关系?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐