【问题标题】:JumpLists Not Working in C# AppJumpLists 在 C# 应用程序中不起作用
【发布时间】:2011-06-02 03:13:02
【问题描述】:

我正在尝试在我的 C# 应用程序中使用最近和频繁跳转列表。我正在使用 Windows API Codepack v1.1 (http://code.msdn.microsoft.com/WindowsAPICodePack)。每次应用程序启动时我都会初始化 JumpLists,每次在应用程序中打开项目时,我都会向 JumpList 添加Recent()。

有些东西丢失了,因为当您右键单击任务栏中的应用程序图标时,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.
        }
    }

我错过了什么?

【问题讨论】:

    标签: c# windows windows-7


    【解决方案1】:

    this page 发生的事情与您看到的问题有密切关系吗?

    【讨论】:

    • 不,我可以很好地固定我的应用程序 - JumpLists 无法正常工作。谢谢。
    【解决方案2】:

    事实证明这是 ClickOnce 部署的限制。使用正常的安装项目,安装后跳转列表按预期工作。

    【讨论】:

      【解决方案3】:

      您是否在应用程序中注册了文件扩展名? (我是我的案例中缺少的部分)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-12-25
        • 2013-11-27
        • 2017-09-28
        • 2016-04-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多