Beispiel #1
0
        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);
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
 public static void Remove()
 {
     ShortcutHelper.Remove();
     SetAddJumpList();
 }
Beispiel #4
0
 public static void Add()
 {
     ShortcutHelper.Create();
     SetRemoveJumpList();
 }