public static bool Check(string[] args) { if (args?.Any() is true) { if (args.Contains(AddOption)) { Add(); return(true); } if (args.Contains(RemoveOption)) { Remove(); return(true); } } if (ShortcutHelper.Exists()) { SetRemoveJumpList(); } else { SetAddJumpList(); } return(false); }
private static void SetJumpList(string title, string description, string arguments) { var(_, executablePath, aliasPath) = ShortcutHelper.GetNamePaths(); JumpTask GetJumpTask() => new JumpTask { Title = title, Description = description, Arguments = arguments, ApplicationPath = (aliasPath ?? executablePath), IconResourcePath = executablePath, IconResourceIndex = 0 }; var jumpList = new JumpList(); jumpList.JumpItems.Add(GetJumpTask()); jumpList.Apply(); }
public static void Remove() { ShortcutHelper.Remove(); SetAddJumpList(); }
public static void Add() { ShortcutHelper.Create(); SetRemoveJumpList(); }