private void UpdateJumpList()
        {
            Taskbar.JumpList jumplist = Taskbar.JumpList.CreateJumpList();
            jumplist.KnownCategoryToDisplay = Taskbar.JumpListKnownCategoryType.Neither;

            Taskbar.JumpListCustomCategory recentProjectsCategory = new Taskbar.JumpListCustomCategory("Recent Solutions");
            Taskbar.JumpListCustomCategory recentFilesCategory    = new Taskbar.JumpListCustomCategory("Recent Files");

            jumplist.AddCustomCategories(recentProjectsCategory, recentFilesCategory);
            jumplist.KnownCategoryOrdinalPosition = 0;

            foreach (RecentFile recentProject in recentFiles.GetProjects())
            {
                // Windows is picky about files that are added to the jumplist. Only files that MonoDevelop
                // has been registered as supported in the registry can be added.
                bool isSupportedFileExtension = this.supportedExtensions.Contains(Path.GetExtension(recentProject.FileName));
                if (isSupportedFileExtension)
                {
                    recentProjectsCategory.AddJumpListItems(new Taskbar.JumpListItem(recentProject.FileName));
                }
            }

            foreach (RecentFile recentFile in recentFiles.GetFiles())
            {
                if (this.supportedExtensions.Contains(Path.GetExtension(recentFile.FileName)))
                {
                    recentFilesCategory.AddJumpListItems(new Taskbar.JumpListItem(recentFile.FileName));
                }
            }

            jumplist.Refresh();
        }
        private void UpdateJumpList()
        {
            Taskbar.JumpList jumplist = Taskbar.JumpList.CreateJumpListForIndividualWindow(
                MonoDevelop.Core.BrandingService.ApplicationName,
                GdkWin32.HgdiobjGet(MessageService.RootWindow.GdkWindow)
                );
            jumplist.KnownCategoryToDisplay = Taskbar.JumpListKnownCategoryType.Neither;

            Taskbar.JumpListCustomCategory recentProjectsCategory = new Taskbar.JumpListCustomCategory("Recent Solutions");
            Taskbar.JumpListCustomCategory recentFilesCategory    = new Taskbar.JumpListCustomCategory("Recent Files");

            jumplist.AddCustomCategories(recentProjectsCategory, recentFilesCategory);
            jumplist.KnownCategoryOrdinalPosition = 0;

            foreach (RecentFile recentProject in recentFiles.GetProjects())
            {
                // Windows is picky about files that are added to the jumplist. Only files that MonoDevelop
                // has been registered as supported in the registry can be added.
                bool isSupportedFileExtension = this.supportedExtensions.Contains(Path.GetExtension(recentProject.FileName));
                if (isSupportedFileExtension)
                {
                    recentProjectsCategory.AddJumpListItems(new Taskbar.JumpListLink(exePath, recentProject.DisplayName)
                    {
                        Arguments     = MonoDevelop.Core.Execution.ProcessArgumentBuilder.Quote(recentProject.FileName),
                        IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(exePath, 0),
                    });
                }
            }

            foreach (RecentFile recentFile in recentFiles.GetFiles())
            {
                if (this.supportedExtensions.Contains(Path.GetExtension(recentFile.FileName)))
                {
                    recentFilesCategory.AddJumpListItems(new Taskbar.JumpListLink(exePath, recentFile.DisplayName)
                    {
                        Arguments     = MonoDevelop.Core.Execution.ProcessArgumentBuilder.Quote(recentFile.FileName),
                        IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(exePath, 0),
                    });
                }
            }

            jumplist.Refresh();
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            _jumpList = JumpList.CreateJumpList();
            _jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Neither;
            _jumpList.AddCustomCategories(_recentCategory);

            List<HistoryWindow.HistoricalConnection> historicalConnections = _history.Connections.OrderBy((HistoryWindow.HistoricalConnection c) => c.LastConnection).ToList();
            historicalConnections = historicalConnections.GetRange(0, Math.Min(historicalConnections.Count, Convert.ToInt32(_jumpList.MaxSlotsInList)));

            foreach (HistoryWindow.HistoricalConnection historicalConnection in historicalConnections)
            {
                _recentCategory.AddJumpListItems(new JumpListLink(Application.ExecutablePath, (!String.IsNullOrEmpty(historicalConnection.Name) ? historicalConnection.Name : historicalConnection.Host)) { Arguments = "/openHistory:" + historicalConnection.Guid.ToString(), IconReference = new IconReference(Application.ExecutablePath, 0) });
                _recentConnections.Enqueue(historicalConnection);
            }

            _jumpList.Refresh();

            if (OpenToHistory != Guid.Empty)
                Connect(_history.FindInHistory(OpenToHistory));
        }
Ejemplo n.º 5
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 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<HistoryWindow.HistoricalConnection> historicalConnections =
                    _history.Connections.OrderBy((HistoryWindow.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 (HistoryWindow.HistoricalConnection historicalConnection in historicalConnections)
                {
                    _recentCategory.AddJumpListItems(
                        new JumpListLink(Application.ExecutablePath, historicalConnection.Connection.DisplayName)
                            {
                                Arguments = "/openHistory:" + historicalConnection.Connection.Guid.ToString(),
                                IconReference = new IconReference(Application.ExecutablePath, 0)
                            });
                    _recentConnections.Enqueue(historicalConnection);
                }

                _jumpList.Refresh();

                if (OpenToHistory != Guid.Empty)
                    SelectedTab = Connect(_history.FindInHistory(OpenToHistory));
            }

            if (OpenToHistory == Guid.Empty && OpenToBookmarks != null)
                ConnectToBookmarks(OpenToBookmarks);
        }
Ejemplo n.º 6
0
        private void OnlineJumpList(ref JumpList jumpList)
        {
            var f = new JumpListCustomCategory("Favorite Contacts");
            foreach (var c in FavJumpListContacts)
            {
                var x = new JumpListLink(System.Windows.Forms.Application.ExecutablePath, c.Name);
                x.Arguments = "\"/jump:" + c.ID.GetHashCode() + "\"";
                //this.Try(() =>x.IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(System.Windows.Forms.Application.ExecutablePath, 0));
                f.AddJumpListItems(x);
            }
            jumpList.AddCustomCategories(f);

            //var task = new JumpListLink(System.Windows.Forms.Application.ExecutablePath, "Show Contact List");
            //task.Arguments = "/show";
            //jumpList.AddUserTasks(task);

            var task = new JumpListLink(System.Windows.Forms.Application.ExecutablePath, "Check for new Messages");
            task.Arguments = "/check";
            //this.Try(() => task.IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(System.Windows.Forms.Application.ExecutablePath, 5));
            jumpList.AddUserTasks(task);

            task = new JumpListLink(System.Windows.Forms.Application.ExecutablePath, "Sync Google Contacts Now");
            task.Arguments = "/update_contacts";
            //this.Try(() => task.IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference(System.Windows.Forms.Application.ExecutablePath, 5));
            jumpList.AddUserTasks(task);
        }
Ejemplo n.º 7
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);
            }
        }