Example #1
0
        public void InitializeJumpLists()
        {
            if (TaskbarManager.IsPlatformSupported)
            {
                if (TaskbarManager.Instance.ApplicationId.IsNullOrEmpty())
                {
                    TaskbarManager.Instance.ApplicationId = Application.ProductName;
                }

                try
                {
                    JumpList recentJumpList = JumpList.CreateJumpList();

                    recentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;
                    recentJumpList.Refresh();
                }
                catch { }

                try
                {
                    JumpList frequentJumpList = JumpList.CreateJumpList();

                    frequentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Frequent;
                    frequentJumpList.Refresh();
                }
                catch { }
            }
        }
Example #2
0
        private async void LoadJumplist()
        {
            await System.Threading.Tasks.Task.Delay(5000);

            JumpList jl = JumpList.CreateJumpList();
            JumpListCustomCategory jlc = new JumpListCustomCategory("µVoice Alpha (Private Build)");

            JumpListLink[] jli = new JumpListLink[] { new JumpListLink("report", "Reportar Un Problema"), new JumpListLink("reports", "Decirle a bit que es mierda."), new JumpListLink("update", "Buscar Actualizaciones") };
            jlc.AddJumpListItems(jli);
            jl.AddCustomCategories(jlc);
            jl.Refresh();
            TaskbarManager.Instance.TabbedThumbnail.SetThumbnailClip(new WindowInteropHelper(this).Handle, new System.Drawing.Rectangle(10, 64, Convert.ToInt32(mainpiano.ActualWidth), Convert.ToInt32(mainpiano.ActualHeight)));
            TabbedThumbnail preview = new TabbedThumbnail(this, mainpiano, new System.Windows.Vector(10000, 10000));

            preview.SetWindowIcon(Properties.Resources.icon);
            preview.Title = this.Title;
            try
            {
                TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview);
            }
            catch { }
            RenderTargetBitmap rtb = new RenderTargetBitmap((int)play.ActualWidth, (int)play.ActualHeight, 96, 96, PixelFormats.Pbgra32);

            rtb.Render(play);
            MemoryStream  stream  = new MemoryStream();
            BitmapEncoder encoder = new BmpBitmapEncoder();

            encoder.Frames.Add(BitmapFrame.Create(rtb));
            encoder.Save(stream);
            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(stream);
            TaskbarManager.Instance.ThumbnailToolBars.AddButtons(mainpiano, new ThumbnailToolBarButton[] { new ThumbnailToolBarButton(System.Drawing.Icon.FromHandle(bmp.GetHicon()), "Play") });
        }
Example #3
0
        public static void CreateApplicationJumpList()
        {
            if (TaskbarManager.IsPlatformSupported)
            {
                try
                {
                    var exePath       = Assembly.GetEntryAssembly().Location;
                    var iconReference = new IconReference(exePath, 0);

                    var jumpList = JumpList.CreateJumpList();
                    if (jumpList != null)
                    {
                        jumpList.AddUserTasks(new JumpListLink(exePath, "New Search")
                        {
                            Arguments = "/new", IconReference = iconReference
                        },
                                              new JumpListLink(exePath, "File Browser")
                        {
                            Arguments = "/fileBrowser", IconReference = iconReference
                        },
                                              new JumpListLink(exePath, "Foobar Browser")
                        {
                            Arguments = "/foobarBrowser", IconReference = iconReference
                        });
                    }

                    jumpList.Refresh();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Trace.TraceError("Could not create jump list: " + ex.Message);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Einträge in der JumpList (Aufgaben) des Tasks erzeugen
        /// 1. Notizen - StikyNot.exe
        /// 2. Snipping - Snipping.exe
        /// 3. Notepad - Notepad.exe
        /// </summary>
        void createTaksJumpList()
        {
            CustomJumpList = JumpList.CreateJumpList();

            CustomJumpList.ClearAllUserTasks();

            JumpListLink EntryNote = new JumpListLink(@"%windir%\system32\StikyNot.exe", "Notizen");

            EntryNote.IconReference = new IconReference(@"%windir%\system32\StikyNot.exe", 0);
            CustomJumpList.AddUserTasks(EntryNote);

            JumpListLink EntrySnipp = new JumpListLink(@"%windir%\system32\SnippingTool.exe", "Snipping");

            EntrySnipp.IconReference = new IconReference(@"%windir%\system32\SnippingTool.exe", 0);
            CustomJumpList.AddUserTasks(EntrySnipp);

            JumpListLink EntryNotepad = new JumpListLink(@"%windir%\system32\Notepad.exe", "Notepad");

            EntryNotepad.IconReference = new IconReference(@"%windir%\system32\Notepad.exe", 0);
            CustomJumpList.AddUserTasks(EntryNotepad);

            JumpListLink EntryCmd = new JumpListLink(@"%windir%\system32\cmd.exe", "Eingabeaufforderung");

            EntryCmd.IconReference = new IconReference(@"%windir%\system32\cmd.exe", 0);
            CustomJumpList.AddUserTasks(EntryCmd);

            if (!string.IsNullOrWhiteSpace(strTCmdPath))
            {
                JumpListLink EntryTCM = new JumpListLink(strTCmdPath, "Total Commander - " + strTCmdVersion);
                EntryTCM.IconReference = new IconReference(strTCmdPath, 0);
                CustomJumpList.AddUserTasks(EntryTCM);
            }

            CustomJumpList.Refresh();
        }
        protected override void OnContentRendered(EventArgs e)
        {
            base.OnContentRendered(e);

            // Disable the minimize button
            var hWnd       = new WindowInteropHelper(this).Handle;
            var windowLong = GetWindowLong(hWnd, GWL_STYLE);

            windowLong = windowLong & ~WS_MAXIMIZEBOX;
            SetWindowLong(hWnd, GWL_STYLE, windowLong);

            _jumpList = JumpList.CreateJumpList();
            _jumpList.Refresh();

            var systemFolder = Environment.GetFolderPath(Environment.SpecialFolder.System);

            _jumpList.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "taskmgr.exe"), "启动任务管理器")
            {
                IconReference = new IconReference(Path.Combine(systemFolder, "taskmgr.exe"), 0)
            });

            _jumpList.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "perfmon.exe"), "启动资源监视器")
            {
                IconReference = new IconReference(Path.Combine(systemFolder, "perfmon.exe"), 0),
                Arguments     = "/res"
            });

            _jumpList.Refresh();
        }
Example #6
0
        private void MainFrm_Shown(object sender, EventArgs e)
        {
            string[] a = Environment.GetCommandLineArgs();
            //Przyciski Aero
            Size s = new Size(16, 16);

            buttonFirst        = new ThumbnailToolbarButton(new Icon(Friends_from_MegaVideo_player.Properties.Resources.back_arrowICO, s), "Odtwórz poprzedni");
            buttonFirst.Click += new EventHandler <ThumbnailButtonClickedEventArgs>(odtwórzPoprzedniToolStripMenuItem_Click);

            buttonSecond        = new ThumbnailToolbarButton(new Icon(Friends_from_MegaVideo_player.Properties.Resources.Forward_ArrowICO, s), "Odtwórz następny");
            buttonSecond.Click += new EventHandler <ThumbnailButtonClickedEventArgs>(odtwórzNastęnyToolStripMenuItem_Click);

            windowsTaskbar.ThumbnailToolbars.AddButtons(this.Handle, buttonFirst, buttonSecond);

            //JumpLista
            JumpList Lista = JumpList.CreateJumpList();

            IJumpListTask zadanie1 = new JumpListLink(@"E:\Gry\Moje dokumenty\Visual Studio 2010\Projects\Friends from MegaVideo player\Friends from MegaVideo player\bin\Debug\Friends from MegaVideo player.exe", "Uruchom notatnik")
            {
                IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(@"E:\Gry\Moje dokumenty\Visual Studio 2010\Projects\Friends from MegaVideo player\Friends from MegaVideo player\bin\Debug\Friends from MegaVideo player.exe", 0),
                Title         = @"c:\widnows\notepad.exe"
            };

            Lista.AddUserTasks(zadanie1);
            Lista.Refresh();
        }
        private void CreateJumpList()
        {
            if (CoreHelpers.RunningOnWin7)
            {
                string   cmdPath  = Assembly.GetEntryAssembly().Location;
                JumpList jumpList = JumpList.CreateJumpList();

                JumpListCustomCategory category = new JumpListCustomCategory("Status Change");
                category.AddJumpListItems(
                    new JumpListLink(cmdPath, Status.Online.ToString())
                {
                    Arguments = Status.Online.ToString()
                },
                    new JumpListLink(cmdPath, Status.Away.ToString())
                {
                    Arguments = Status.Away.ToString()
                },
                    new JumpListLink(cmdPath, Status.Busy.ToString())
                {
                    Arguments = Status.Busy.ToString()
                });
                jumpList.AddCustomCategories(category);

                jumpList.Refresh();
            }
        }
Example #8
0
        public static void UpdateTaskbarServers()
        {
            if (!TaskbarManager.IsPlatformSupported)
            {
                return;
            }

            var jl             = JumpList.CreateJumpList();
            var serverCategory = new JumpListCustomCategory("Servers");

            string exe = Process.GetCurrentProcess().MainModule.FileName;

            IList <ServerEntry> servers = Servers.GetEntries().ToList();

            JumpListLink[] links = new JumpListLink[servers.Count];
            for (int i = 0; i < servers.Count; ++i)
            {
                var s = servers[i];
                links[i] = new JumpListLink(exe, s.Name)
                {
                    Arguments     = s.Id.ToString(),
                    IconReference = new IconReference(exe, 1)
                };
            }

            serverCategory.AddJumpListItems(links);

            jl.AddCustomCategories(serverCategory);

            try {
                jl.Refresh();
            } catch (UnauthorizedAccessException) {             // Jumplists disabled
            }
        }
Example #9
0
        /// <summary>
        /// Creates a JumpList for the given application instance.
        /// It also adds thumbnail toolbars, which are a set of up to seven buttons at the bottom of the taskbar’s icon thumbnail preview.
        /// </summary>
        /// <param name="windowHandle">The application instance's main window handle.</param>
        /// <param name="buttons">The thumbnail toolbar buttons to be added.</param>
        public void CreateJumpList(IntPtr windowHandle, WindowsThumbnailToolbarButtons buttons)
        {
            if (ToolbarButtonsCreated || !IsSupported || windowHandle == IntPtr.Zero)
            {
                return;
            }

            SafeInvoke(() =>
            {
                // One ApplicationId, so all windows must share the same jumplist
                var jumpList = JumpList.CreateJumpList();
                jumpList.ClearAllUserTasks();
                jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;
                jumpList.Refresh();

                CreateTaskbarButtons(windowHandle, buttons);
            }, nameof(CreateJumpList));

            return;

            void CreateTaskbarButtons(IntPtr handle, WindowsThumbnailToolbarButtons thumbButtons)
            {
                _commitButton        = new ThumbnailToolBarButton(MakeIcon(thumbButtons.Commit.Image, 48, true), thumbButtons.Commit.Text);
                _commitButton.Click += thumbButtons.Commit.Click;

                _pushButton        = new ThumbnailToolBarButton(MakeIcon(thumbButtons.Push.Image, 48, true), thumbButtons.Push.Text);
                _pushButton.Click += thumbButtons.Push.Click;

                _pullButton        = new ThumbnailToolBarButton(MakeIcon(thumbButtons.Pull.Image, 48, true), thumbButtons.Pull.Text);
                _pullButton.Click += thumbButtons.Pull.Click;

                // Call this method using reflection.  This is a workaround to *not* reference WPF libraries, becuase of how the WindowsAPICodePack was implimented.
                TaskbarManager.Instance.ThumbnailToolBars.AddButtons(handle, _commitButton, _pullButton, _pushButton);
            }
        }
Example #10
0
            public void RebindProfiles(IEnumerable <ClientProfile> profiles)
            {
                JumpListCustomCategory category = new JumpListCustomCategory("Profiles");

                int currentIndex = 0;

                foreach (var profile in profiles)
                {
                    JumpListLink link = new JumpListLink(Application.ExecutablePath, "--load-profile-" + currentIndex);
                    link.Title         = profile.ProfileName;
                    link.Arguments     = "--load-profile-" + currentIndex.ToString();
                    link.IconReference = JumpListIconManager.CreateIconForClient(profile.Client);
                    currentIndex++;
                    category.AddJumpListItems(link);
                }

                JumpList list = JumpList.CreateJumpList();

                list.ClearAllUserTasks();
                list.AddCustomCategories(category);

                JumpListLink newProfileLink = new JumpListLink(Application.ExecutablePath, "New Profile...");

                newProfileLink.Arguments     = "--new-profile";
                newProfileLink.IconReference = new IconReference(Application.ExecutablePath, 0);
                list.AddUserTasks(newProfileLink);

                list.Refresh();
            }
Example #11
0
        public static void UpdateJumpList()
        {
            // Create a Jump List for AML Studio connections
            try
            {
                var          list     = JumpList.CreateJumpList();
                var          currPath = Program.AssemblyPath;
                JumpListLink link;
                var          links = new List <IJumpListItem>();

                foreach (var conn in ConnectionManager.Current.Library.Connections)
                {
                    link               = new JumpListLink(currPath, conn.ConnectionName);
                    link.Arguments     = "\"/amlstudio:" + conn.ConnectionName + "\"";
                    link.IconReference = new IconReference(currPath, 1);
                    links.Add(link);
                }

                var amlStudioCat = new JumpListCustomCategory("AML Studio");
                amlStudioCat.AddJumpListItems(links.ToArray());
                list.AddCustomCategories(amlStudioCat);
                list.Refresh();
            }
            catch (Exception) { }
        }
Example #12
0
        public static void Update()
        {
            if (IsSupported())
            {
                JumpList    jumpList = JumpList.CreateJumpList();
                List <Prog> progs    = new ProgList().GetJumpList();
                progs.Reverse();

                foreach (Prog prog in progs)
                {
                    var task = new JumpListLink(System.Reflection.Assembly.GetEntryAssembly().Location, prog.Name)
                    {
                        Arguments = "start " + prog.ID
                    };
                    if (File.Exists(prog.Icon))
                    {
                        task.IconReference = new IconReference(@prog.Icon, 0);
                    }
                    task.WorkingDirectory = Environment.CurrentDirectory;
                    jumpList.AddUserTasks(task);
                }

                jumpList.Refresh();
            }
        }
Example #13
0
        /// <summary>
        /// Creates the recently used ports jumplist
        /// </summary>
        private void CreateJumpList()
        {
            taskBarManager = TaskbarManager.Instance;
            if (TaskbarManager.IsPlatformSupported)
            {
                string currentDir = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName;

                JumpList list = JumpList.CreateJumpList();

                // Separate by service hosts the recent ports.
                Port.GetUsedPorts().GroupBy(p => p.ServiceHost).ToList().ForEach(group => {
                    JumpListCustomCategory userActionsCategory = new JumpListCustomCategory(group.Key);

                    group.OrderByDescending(p => p.UsedTimes).ToList().ForEach(port =>
                    {
                        JumpListLink userActionLink = new JumpListLink(Assembly.GetEntryAssembly().Location,
                                                                       string.Format("{0} @ {1}", port.Number.ToString(), port.Host))
                        {
                            Arguments     = port.Id.ToString(),
                            IconReference = new IconReference(currentDir + "\\Resources\\tunnel-jump.ico,0")
                        };
                        userActionsCategory.AddJumpListItems(userActionLink);
                    });

                    list.AddCustomCategories(userActionsCategory);
                });

                list.Refresh();
            }
        }
Example #14
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            TaskbarManager.Instance.SetProgressValue(0, hscrTaskbarProgress.Maximum);
            TaskbarManager.Instance.SetOverlayIcon(this.Icon, "Taskbar Demo Application");

            JumpList list = JumpList.CreateJumpList();//JumpList.CreateJumpListForIndividualWindow("TaskbarDemo.Form1", this.Handle);
            JumpListCustomCategory jcategory = new JumpListCustomCategory("My New Category");

            list.ClearAllUserTasks();
            string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            //jcategory.AddJumpListItems(new JumpListItem(Path.Combine(desktop, "a.abc")));
            list.AddCustomCategories(jcategory);

            string systemFolder = Environment.GetFolderPath(Environment.SpecialFolder.System);

            //Add links to Tasks
            list.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "notepad.exe"), "Open Notepad")
            {
                IconReference = new IconReference(Path.Combine(systemFolder, "notepad.exe"), 0)
            });
            list.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "calc.exe"), "Open Calculator")
            {
                IconReference = new IconReference(Path.Combine(systemFolder, "calc.exe"), 0)
            });
            list.AddUserTasks(new JumpListSeparator());
            list.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "mspaint.exe"), "Open Paint")
            {
                IconReference = new IconReference(Path.Combine(systemFolder, "mspaint.exe"), 0)
            });
            //Adding links to RecentItems
            //list.AddToRecent(Path.Combine(systemFolder, "mspaint.exe"));
            list.Refresh();
        }
        void TaskbarDemoMainForm_Shown(object sender, EventArgs e)
        {
            // create a new taskbar jump list for the main window
            jumpList = JumpList.CreateJumpList();

            // Add custom categories
            jumpList.AddCustomCategories(category1, category2);

            // Default values for jump lists
            comboBoxKnownCategoryType.SelectedItem = "Recent";

            // Progress Bar
            foreach (string state in Enum.GetNames(typeof(TaskbarProgressBarState)))
            {
                comboBoxProgressBarStates.Items.Add(state);
            }

            //
            comboBoxProgressBarStates.SelectedItem = "NoProgress";

            // Update UI
            UpdateStatusBar("Application ready...");

            // Set our default
            TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.NoProgress);
        }
Example #16
0
        void RebuildRecentJumpList()
        {
            if (!File.Exists(_recentFiles))
            {
                return;
            }

            var files = File.ReadAllLines(_recentFiles);


            _jumpList = JumpList.CreateJumpList();
            List <JumpListTask> tasks = new List <JumpListTask>();

            List <JumpListCustomCategory> cats = new List <JumpListCustomCategory>();

            foreach (var item in files)
            {
                var fi = new FileInfo(item);

                var task = new JumpListLink(Assembly.GetEntryAssembly().Location, fi.Name + "    (" + fi.DirectoryName + ")");
                task.WorkingDirectory = fi.DirectoryName;
                task.Arguments        = item;


                tasks.Add(task);
            }

            _jumpList.AddUserTasks(tasks.ToArray());
            _jumpList.Refresh();
        }
Example #17
0
        /// <summary>
        /// Handler method that's called when the form is shown.  Creates and initializes the jump list if necessary and, if they are specified, opens the
        /// bookmarks specified by <see cref="OpenToBookmarks"/> or the history entries pointed to by <see cref="OpenToHistory"/>.
        /// </summary>
        /// <param name="e">Arguments associated with this event.</param>
        protected override async void OnShown(EventArgs e)
        {
            base.OnShown(e);

            if (_jumpList == null)
            {
                _jumpList = JumpList.CreateJumpList();
                _jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Neither;
                _jumpList.AddCustomCategories(_recentCategory);

                // Get all of the historical connections and order them by their last connection times
                List <HistoricalConnection> historicalConnections =
                    History.Instance.Connections.OrderBy((HistoricalConnection c) => c.LastConnection).ToList();
                historicalConnections = historicalConnections.GetRange(0, Math.Min(historicalConnections.Count, Convert.ToInt32(_jumpList.MaxSlotsInList)));

                // Add each history entry to the jump list
                foreach (HistoricalConnection historicalConnection in historicalConnections)
                {
                    try
                    {
                        _recentCategory.AddJumpListItems(
                            new JumpListLink(Application.ExecutablePath, historicalConnection.Connection.DisplayName)
                        {
                            Arguments     = "/openHistory:" + historicalConnection.Connection.Guid.ToString(),
                            IconReference = new IconReference(Application.ExecutablePath, 0)
                        });
                    }

                    // Turning off the "show recent documents in the taskbar and start menu" setting in the start menu properties
                    // can cause adding a jump list item to throw an exception, so just ignore the error and continue
                    catch (Exception)
                    {
                    }

                    _recentConnections.Enqueue(historicalConnection);
                }

                try
                {
                    _jumpList.Refresh();
                }

                // Turning off the "show recent documents in the taskbar and start menu" setting in the start menu properties
                // can cause adding a jump list item to throw an exception, so just ignore the error and continue
                catch (Exception)
                {
                }

                if (OpenToHistory != Guid.Empty)
                {
                    SelectedTab = await Connect(History.Instance.FindInHistory(OpenToHistory));
                }
            }

            if (OpenToHistory == Guid.Empty && OpenToBookmarks != null)
            {
                await ConnectToBookmarks(OpenToBookmarks);
            }
        }
 /// <summary>
 /// Override this method to recieve notification when the taskbar button is created on Windows 7 machines and above.
 /// </summary>
 protected void OnTaskbarButtonCreated()
 {
     if (TaskbarManager.IsPlatformSupported)
     {
         jumpList = JumpList.CreateJumpList();
         jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;
         jumpList.Refresh();
     }
 }
Example #19
0
        /// <summary>
        /// Refreshes the jump list from data.
        /// </summary>
        private static void RefreshJumpListFromData()
        {
            try
            {
                if (TaskbarManager.IsPlatformSupported)
                {
                    JumpListCustomCategory customCategory = new JumpListCustomCategory("Recent");
                    _jumpList = JumpList.CreateJumpList();

                    for (int count = _recentJumpList.Count - 1; count >= 0; count--)
                    {
                        JumpListLink jumpListLink = new JumpListLink(ExePath, _recentJumpList.ElementAt(count).Value);
                        jumpListLink.Title = _recentJumpList.ElementAt(count).Value;
                        if (_isAdmin)
                        {
                            jumpListLink.Arguments     = AdminArgument + " " + _recentJumpList.ElementAt(count).Key;
                            jumpListLink.IconReference = new IconReference(AdminIconPath, 0);
                        }
                        else
                        {
                            jumpListLink.Arguments     = GameArgument + " " + _recentJumpList.ElementAt(count).Key;
                            jumpListLink.IconReference = new IconReference(GameIconPath, 0);
                        }
                        customCategory.AddJumpListItems(jumpListLink);
                    }

                    _jumpList.AddCustomCategories(customCategory);

                    if (_isAdmin)
                    {
                        // create new deck CMD
                        _jumpList.AddUserTasks(new JumpListLink(ExePath, (string)Application.Current.FindResource("Resource_JumpList_Task_CreateNewCardDeck"))
                        {
                            Title         = (string)Application.Current.FindResource("Resource_JumpList_Task_CreateNewCardDeck"),
                            Arguments     = CreateNewCardDeckArgument,
                            IconReference = new IconReference(AdminIconPath, 0)
                        });
                    }
                    else //user, add task to launch the Admin
                    {
                        // Start Admin instance
                        _jumpList.AddUserTasks(new JumpListLink(ExePath, (string)Application.Current.FindResource("Resource_JumpList_Task_StartAdmin"))
                        {
                            Title         = (string)Application.Current.FindResource("Resource_JumpList_Task_StartAdmin"),
                            Arguments     = AdminArgument,
                            IconReference = new IconReference(AdminIconPath, 0)
                        });
                    }

                    _jumpList.Refresh();
                }
            }
            catch (Exception e)
            {
                Utils.LogException(MethodBase.GetCurrentMethod(), e);
            }
        }
Example #20
0
 private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     WindowJumpList = JumpList.CreateJumpList();
     initializeJumplist();
     if (initState != null)
     {
         updateState(initState);
     }
 }
Example #21
0
 public static void ClearJumplist()
 {
     if (!Win7.IsWin7)
     {
         return;
     }
     jumplist = JumpList.CreateJumpList();
     jumplist.ClearAllUserTasks();
     jumplist.Refresh();
 }
Example #22
0
        private void AddToJumplist(string fileName)
        {
            if (TaskbarManager.IsPlatformSupported)
            {
                JumpList.AddToRecent(fileName);

                if (this.Visible)
                {
                    var jumplist = JumpList.CreateJumpList();
                    jumplist.Refresh();
                }
            }
        }
Example #23
0
        public static void Jumplist()
        {
            if (!Win7.IsWin7)
            {
                return;
            }

            try
            {
                jumplist = JumpList.CreateJumpList();
                jumplist.ClearAllUserTasks();
                jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Shutdown"])
                {
                    IconReference = new IconReference(Data.EXE, 1), Arguments = "-s"
                });
                jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Restart"])
                {
                    IconReference = new IconReference(Data.EXE, 2), Arguments = "-r"
                });
                jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Logoff"])
                {
                    IconReference = new IconReference(Data.EXE, 3), Arguments = "-l"
                });
                jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Lock"])
                {
                    IconReference = new IconReference(Data.EXE, 3), Arguments = "-lo"
                });
                jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Standby"])
                {
                    IconReference = new IconReference(Data.EXE, 4), Arguments = "-sb"
                });
                jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Hibernate"])
                {
                    IconReference = new IconReference(Data.EXE, 4), Arguments = "-h"
                });
                if (Data.S["WOSB"])
                {
                    jumplist.AddUserTasks(new JumpListSeparator());
                    jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["HibernateWOSBIni"])
                    {
                        IconReference = new IconReference(Data.EXE, 5), Arguments = "-hi"
                    });
                    //jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["HibernateWOSBTime"]) { IconReference = new IconReference(Data.EXE, 5), Arguments = "-ht" });
                }
                //jumplist.AddUserTasks(new JumpListSeparator());
                //jumplist.AddUserTasks(new JumpListLink(Data.EXE, Data.L["Abort"]) { IconReference = new IconReference(EXE, 6), Arguments = "-a", WorkingDirectory = Path.GetDirectoryName(EXE) });

                jumplist.Refresh();
            }
            catch { }
        }
Example #24
0
        internal static void InitJumpList()
        {
            jumpList = JumpList.CreateJumpList();
            jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Neither;
            jumpList.ClearAllUserTasks();
            string       ourFileName = Assembly.GetEntryAssembly().Location;
            JumpListLink quitLink    = new JumpListLink(ourFileName, "Quit PeaRoxy")
            {
                Arguments = "--quit",
            };

            jumpList.AddUserTasks(new JumpListTask[] { quitLink });
            jumpList.Refresh();
        }
Example #25
0
        void Form1_Shown(object sender, System.EventArgs e)
        {
            //thumbnail toolbar button setup
            buttonAdd         = new ThumbnailToolbarButton(Properties.Resources.feed, "Add New Subscription");
            buttonAdd.Enabled = true;
            buttonAdd.Click  += new EventHandler <ThumbnailButtonClickedEventArgs>(buttonAdd_Click);

            buttonRefresh         = new ThumbnailToolbarButton(Properties.Resources.feedRefresh, "Refresh Feeds");
            buttonRefresh.Enabled = true;
            buttonRefresh.Click  += new EventHandler <ThumbnailButtonClickedEventArgs>(buttonRefresh_Click);

            TaskbarManager.Instance.ThumbnailToolbars.AddButtons(this.Handle, buttonAdd, buttonRefresh);
            TaskbarManager.Instance.TabbedThumbnail.SetThumbnailClip(this.Handle, new Rectangle(pictureBox1.Location, pictureBox1.Size));

            string systemFolder = Environment.GetFolderPath(Environment.SpecialFolder.System);

            //setup jumplist
            jumpList = JumpList.CreateJumpList();
            category1.AddJumpListItems(new JumpListLink(Path.Combine(systemFolder, "notepad.exe"), "SteveSi's Office Hours"));
            category2.AddJumpListItems(new JumpListLink(Path.Combine(systemFolder, "mspaint2.exe"), "Add Google Reader Feeds")
            {
                IconReference = new IconReference(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\google.bmp"), 0)
            });
            category2.AddJumpListItems(new JumpListLink(Path.Combine(systemFolder, "mspaint3.exe"), "Add Facebook News Feed")
            {
                IconReference = new IconReference(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\facebook.ico"), 0)
            });
            category2.AddJumpListItems(new JumpListLink(Path.Combine(systemFolder, "mspaint4.exe"), "Refresh Feeds")
            {
                IconReference = new IconReference(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\feedRefresh.ico"), 0)
            });
            jumpList.AddCustomCategories(category1, category2);
            jumpList.AddUserTasks(new JumpListSeparator());

            JumpListCustomCategory empty = new JumpListCustomCategory(String.Empty);

            empty.AddJumpListItems(new JumpListLink("http://www.rssbandit.org", "Go to rssbandit.org")
            {
                IconReference = new IconReference(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\app.ico"), 0)
            });

            jumpList.AddCustomCategories(empty);

            TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.NoProgress);
            jumpList.Refresh();

            windowsTaskbar.SetOverlayIcon(this.Handle, Properties.Resources.envelope, "New Items");
            // windowsTaskbar.SetOverlayIcon(this.Handle, null, null); <-- to clear
        }
Example #26
0
        private void JumpListeAkt()
        {
            JumpList list = JumpList.CreateJumpList();

            list.ClearAllUserTasks();
            for (int i = 0; i < _dict.Namen.Length; i++)
            {
                JumpListLink j = new JumpListLink(Application.ExecutablePath, _dict.Namen[i]);
                j.Arguments     = i.ToString();
                j.IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe"), 0);
                list.AddUserTasks(j);
            }
            list.AddUserTasks(new JumpListLink(Application.StartupPath, "open directory"));
            list.Refresh();
        }
Example #27
0
        static TaskBarJumpList()
        {
            if (WindowsId.ToInt32() == 0)
            {
                list = JumpList.CreateJumpList();
            }
            else
            {
                list = JumpList.CreateJumpListForIndividualWindow(TaskbarManager.Instance.ApplicationId, WindowsId);
            }

            list.ClearAllUserTasks();
            list.Refresh();
            categories = new Dictionary <string, JumpListCustomCategory>();
        }
Example #28
0
 private static void InitJumpList()
 {
     try
     {
         if (_jumpListManager == null)
         {
             TaskbarManager.Instance.ApplicationId = PreferencesFactory.get().getProperty("application.name");
             _jumpListManager = JumpList.CreateJumpList();
             _jumpListManager.AddCustomCategories(bookmarkCategory = new JumpListCustomCategory("History"));
         }
     }
     catch (Exception exception)
     {
         Logger.warn("Exception while initializing jump list", exception);
     }
 }
Example #29
0
 private void ClearJumpList()
 {
     try
     {
         JumpList jumpList = JumpList.CreateJumpList();
         jumpList.JumpListItemsRemoved += (ss, ee) => { };
         foreach (var x in jumpList.RemovedDestinations)
         {
         }
         jumpList.Refresh();
     }
     catch (Exception ex)
     {
         Trace.Write("JumpList Error: " + ex);
     }
 }
Example #30
0
        public static void RegisterTasks()
        {
            Debug.Assert(TaskbarManager.IsPlatformSupported);

            if (Properties.Settings.Default.UserTasksInitialized)
            {
                return;
            }

            Properties.Settings.Default.UserTasksInitialized = true;
            Properties.Settings.Default.Save();

            var jumpList = JumpList.CreateJumpList();

            jumpList.ClearAllUserTasks();

            var imgres = Path.Combine(HolzShotsPaths.SystemPath, "imageres.dll");

            if (File.Exists(imgres))
            {
                var fullscreen = new JumpListLink(Application.ExecutablePath, "Capture entire screen")
                {
                    Arguments     = CommandLine.FullscreenScreenshotCliCommand,
                    IconReference = new IconReference(imgres, 105),
                };
                jumpList.AddUserTasks(fullscreen);
            }

            var selector = new JumpListLink(Application.ExecutablePath, "Capture Region")
            {
                Arguments     = CommandLine.AreaSelectorCliCommand,
                IconReference = new IconReference(Application.ExecutablePath, 0),
            };

            jumpList.AddUserTasks(selector);

            try
            {
                jumpList.Refresh();
            }
            catch (UnauthorizedAccessException)
            {
                // No deal when this fails :)
            }
        }