Reputation:
I am working on a C# application and trying to implement jump lists using the JumpList class from the Microsoft.WindowsAPICodePack.Taskbar namespace. However, I am encountering the following errors and could use some assistance in resolving them:
CS0176: Member 'JumpList.AddToRecent(string)' cannot be accessed with an instance reference; qualify it with a type name instead:
CS1503: Argument 1: cannot convert from 'System.Uri' to 'string?':
if (TaskbarManager.IsPlatformSupported)
{
// Create a jump list
JumpList jumpList = JumpList.CreateJumpList();
// Add recent items
jumpList.AddToRecent("C:\\Path\\To\\RecentFile.txt");
// Add custom tasks
JumpListLink customTask = new JumpListLink(new Uri("C:\\Path\\To\\Executable.exe"), "Custom Task");
jumpList.AddUserTasks(customTask);
// Save the jump list
jumpList.Refresh();
}
Upvotes: 0
Views: 75