- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在填充 jumplist通过:
public static void AddToList(String path)
{
var jumpList = JumpList.GetJumpList(Application.Current);
if (jumpList == null) return;
string title = System.IO.Path.GetFileName(path);
string programLocation = Assembly.GetCallingAssembly().Location;
var jt = new JumpTask
{
ApplicationPath = programLocation,
Arguments = path,
Description = path,
IconResourcePath = programLocation,
Title = title
};
JumpList.AddToRecentCategory(jt);
jumpList.Apply();
}
效果很好。唯一的问题是我的应用程序中也有一个文件菜单,我也想在那里显示最近的列表。我可以通过存储最近文件的第二个副本来轻松做到这一点,但我想知道我是否可以枚举跳转列表使用的文件列表。我还没有想出任何这样做的办法。
我是不是漏掉了什么?我可以枚举跳转列表中的文件,还是需要存储自己的重复列表?
最佳答案
我检查了你的代码。我对此有疑问。我调查了MSDN您提供的页面。在那里我看到了添加任务的例子:
private void AddTask(object sender, RoutedEventArgs e)
{
//....
//Mostly the same code as your
JumpList jumpList1 = JumpList.GetJumpList(App.Current);
jumpList1.JumpItems.Add(jumpTask1); // It is absent in your code!!!
JumpList.AddToRecentCategory(jumpTask1);
jumpList1.Apply();
}
我已经创建了两个我自己的方法 Create
和 Extract
并且我至少可以访问在当前 session 任务期间创建的。这是我的代码:
private void Extract()
{
var jumpList = JumpList.GetJumpList(Application.Current);
if (jumpList == null) return;
foreach (var item in jumpList.JumpItems)
{
if(item is JumpTask)
{
var jumpTask = (JumpTask)item;
Debug.WriteLine(jumpTask.Title);
}
}
}
private void Create() {
var jumpList = JumpList.GetJumpList(Application.Current);
if (jumpList == null)
{
jumpList = new JumpList();
JumpList.SetJumpList(Application.Current, jumpList);
}
string title = "Title";
string programLocation = "Location";
var path = "path";
var jt = new JumpTask
{
ApplicationPath = programLocation,
Arguments = path,
Description = path,
IconResourcePath = programLocation,
Title = title
};
jumpList.JumpItems.Add(jt);
JumpList.AddToRecentCategory(jt);
jumpList.Apply();
}
我不确定这是否是您问题的答案,但我正在寻找您不将任务添加到 JumpItems 的原因。名单?
关于c# - 枚举 JumpList 最近的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25855525/
如何使用 Windows 窗体在任务栏中右键单击时创建菜单? 像这样: 最佳答案 您可以简单地将工具箱中的 contextMenuStrip 添加到 form1。然后转到 form1 properti
因此,我的 WPF 应用程序在 App.xaml 中定义了一个跳转列表 此列表为空,除非 Windows 识别出与我的应用程序关联的某些文件。我设法通过 Inno Setup 关联了我的
我在 main.cpp 中有以下代码: QApplication a(argc, argv); QWinJumpListItem wjli(QWinJumpListItem::Link); wjli1
我正在填充 jumplist通过: public static void AddToList(String path) { var jumpList = JumpLis
目前我正在开发一个应用程序并想添加一个 Windows (7) JumpList。我遵循了几个教程并研究了文档,但我无法弄清楚如何完成工作。简而言之:我想要最近选择的文件列表。因此,关闭应用程序后,用
我有一个使用 JumpList(仅限最近)的 WPF 应用程序。一切正常,直到我使用 ClickOnce 部署它 - JumpList 根本不显示(顺便说一句,在 VS 调试器下运行时它也没有显示。
我正在尝试在我的 C# 应用程序中使用 Recent 和 Frequent JumpLists。我正在使用 Windows API 代码包 v1.1 (http://code.msdn.microso
在我所有表单的 OnCreate 事件中,我将它们的名称添加到 JumpList var i: Integer; begin if JumpList = nil then JumpLi
跳转列表的 Vim 默认行为如下 The following commands are "jump" commands: "'", "`", "G", "/", "?", "n", "N", "%",
我在使用 WPF 时遇到了一些问题。当我将标签添加到 app.xaml 时,我可以在跳转列表中看到该任务,但是当我尝试将项目添加到最近的文件列表时,我添加的新项目永远不会显示。如果我创建一个名为“Re
我知道如何为我的应用程序构建 JumpList。但现在我想显示特定“.exe”文件的跳转列表。我有一个“.exe”文件的路径,我需要显示该应用程序的跳转列表。当用户在任务栏上的应用程序图标上单击鼠标右
我正在尝试在 Windows 10 中使用 JumpTask 从任务栏运行自定义命令,但它不会启动链接的应用程序。但是它正确显示了 JumpTask 链接及其图标。这是在 Win7/Win8 中正常工
我正在使用适用于 Microsoft .NET Framework 的 Windows API 代码包来试用 Win7 任务栏的一些新 UI 功能。我正在用 C# 编写代码。 我有一个关于跳转列表的问
我正在寻找一种使用 Windows API 通过纯 C 或 C++ 使用 JumpLists 的方法。 Code Pack似乎仅适用于 .NET。 有没有不用 .NET 使用 C/C++ 来实现它们的
据我了解,使用 Windows API 代码包的 JumpList 实现现在已被弃用,因为 Microsoft 现在通过 Microsoft .NET Framework 4.0 直接支持 JumpL
我是一名优秀的程序员,十分优秀!