我正在通过以下方式填充跳转列表:
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();
}
效果很好。唯一的问题是我的应用程序中还有一个文件菜单,并且还想在那里显示最近的列表。我可以通过存储最近文件的第二个副本轻松做到这一点,但我想知道是否可以枚举跳转列表使用的文件列表。我一直无法弄清楚这样做的任何事情。
我在这里错过了什么吗?我可以枚举跳转列表中的文件,还是需要存储我自己的重复列表?