private static object GetShellObjectForJumpItem(JumpItem jumpItem) { JumpPath jumpPath = jumpItem as JumpPath; JumpTask jumpTask = jumpItem as JumpTask; if (jumpPath != null) { return(JumpList.CreateItemFromJumpPath(jumpPath)); } if (jumpTask != null) { return(JumpList.CreateLinkFromJumpTask(jumpTask, true)); } return(null); }
public static void AddToRecentCategory(JumpTask jumpTask) { Verify.IsNotNull <JumpTask>(jumpTask, "jumpTask"); if (Utilities.IsOSWindows7OrNewer) { IShellLinkW shellLinkW = JumpList.CreateLinkFromJumpTask(jumpTask, false); try { if (shellLinkW != null) { NativeMethods2.SHAddToRecentDocs(shellLinkW); } } finally { Utilities.SafeRelease <IShellLinkW>(ref shellLinkW); } } }