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(); }
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.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(); }
public void InjectJumpListMenu() { IntPtr? handle = GetWindowHandleOrNull(); if (!handle.HasValue) return; string cmdPath = Assembly.GetEntryAssembly().Location; var jumpList = JumpList.CreateJumpListForIndividualWindow("headless-slacker", handle.Value); var category = new JumpListCustomCategory("Headless Slack"); var hideCommand = new JumpListLink(cmdPath, "Hide Taskbar Icon") { Arguments = "/h", IconReference = new IconReference(cmdPath, 0) }; category.AddJumpListItems(hideCommand); jumpList.AddCustomCategories(category); jumpList.Refresh(); }
private void UpdateJumpList () { Taskbar.JumpList jumplist = Taskbar.JumpList.CreateJumpListForIndividualWindow ( MonoDevelop.Core.BrandingService.ApplicationName, GdkWin32.HgdiobjGet (MessageService.RootWindow) ); 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 (); }
internal void ZScreen_Windows7onlyTasks() { if (!Engine.ConfigApp.Windows7TaskbarIntegration) { if (Engine.zJumpList != null) { Engine.zJumpList.ClearAllUserTasks(); Engine.zJumpList.Refresh(); } } else if (!IsDisposed && !_Windows7TaskbarIntegrated && Engine.ConfigApp.Windows7TaskbarIntegration && this.Handle != IntPtr.Zero && TaskbarManager.IsPlatformSupported && this.ShowInTaskbar) { try { Engine.CheckFileRegistration(); Engine.zWindowsTaskbar = TaskbarManager.Instance; Engine.zWindowsTaskbar.ApplicationId = Engine.appId; Engine.zJumpList = JumpList.CreateJumpList(); // User Tasks JumpListLink jlCropShot = new JumpListLink(Adapter.ZScreenCliPath(), "Crop Shot"); jlCropShot.Arguments = "-cc"; jlCropShot.IconReference = new IconReference(Adapter.ResourcePath, 1); Engine.zJumpList.AddUserTasks(jlCropShot); JumpListLink jlSelectedWindow = new JumpListLink(Adapter.ZScreenCliPath(), "Selected Window"); jlSelectedWindow.Arguments = "-sw"; jlSelectedWindow.IconReference = new IconReference(Adapter.ResourcePath, 2); Engine.zJumpList.AddUserTasks(jlSelectedWindow); JumpListLink jlClipboardUpload = new JumpListLink(Adapter.ZScreenCliPath(), "Clipboard Upload"); jlClipboardUpload.Arguments = "-cu"; jlClipboardUpload.IconReference = new IconReference(Adapter.ResourcePath, 3); Engine.zJumpList.AddUserTasks(jlClipboardUpload); JumpListLink jlHistory = new JumpListLink(Application.ExecutablePath, "Open History"); jlHistory.Arguments = "-hi"; jlHistory.IconReference = new IconReference(Adapter.ResourcePath, 4); Engine.zJumpList.AddUserTasks(jlHistory); // Recent Items Engine.zJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent; // Custom Categories JumpListCustomCategory paths = new JumpListCustomCategory("Paths"); JumpListLink imagesJumpListLink = new JumpListLink(FileSystem.GetImagesDir(), "Images"); imagesJumpListLink.IconReference = new IconReference(Path.Combine("%windir%", "explorer.exe"), 0); JumpListLink settingsJumpListLink = new JumpListLink(Engine.SettingsDir, "Settings"); settingsJumpListLink.IconReference = new IconReference(Path.Combine("%windir%", "explorer.exe"), 0); JumpListLink logsJumpListLink = new JumpListLink(Engine.LogsDir, "Logs"); logsJumpListLink.IconReference = new IconReference(Path.Combine("%windir%", "explorer.exe"), 0); paths.AddJumpListItems(imagesJumpListLink, settingsJumpListLink, logsJumpListLink); Engine.zJumpList.AddCustomCategories(paths); // Taskbar Buttons ThumbnailToolBarButton cropShot = new ThumbnailToolBarButton(Resources.shape_square_ico, "Crop Shot"); cropShot.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(cropShot_Click); ThumbnailToolBarButton selWindow = new ThumbnailToolBarButton(Resources.application_double_ico, "Selected Window"); selWindow.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(selWindow_Click); ThumbnailToolBarButton clipboardUpload = new ThumbnailToolBarButton(Resources.clipboard_upload_ico, "Clipboard Upload"); clipboardUpload.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(clipboardUpload_Click); ThumbnailToolBarButton openHistory = new ThumbnailToolBarButton(Resources.pictures_ico, "History"); openHistory.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(OpenHistory); if (!IsDisposed) { Engine.zWindowsTaskbar.ThumbnailToolBars.AddButtons(this.Handle, cropShot, selWindow, clipboardUpload, openHistory); Engine.zJumpList.Refresh(); } _Windows7TaskbarIntegrated = true; DebugHelper.WriteLine("Integrated into Windows 7 Taskbar"); } catch (Exception ex) { DebugHelper.WriteException(ex, "Error while configuring Windows 7 Taskbar"); } } DebugHelper.WriteLine(new StackFrame().GetMethod().Name); }
private void UpdateMailsJumpList() { if (!_Config.RecentDocsTracked) { return; } _JumpList.RemoveCustomCategories(); Dictionary<string, List<JumpListLink>> dictionary = new Dictionary<string, List<JumpListLink>>(); int i = 0; int unreadCount = Math.Min(_UnreadTotal, (int)_JumpList.MaxSlotsInList); int index = 0; int mailCount = 0; while (i < unreadCount) { String linkText; Notifier notifier = _Instances[_Config.Accounts[index].FullAddress]; Account account = _Config.Accounts[notifier.AccountIndex]; if (Locale.Current.IsRightToLeftLanguage) { linkText = String.Concat("(", notifier.Unread, ") ", account.FullAddress, " "); } else { linkText = String.Concat(account.FullAddress, " (", notifier.Unread, ")"); } if (!dictionary.ContainsKey(linkText)) { dictionary.Add(linkText, new List<JumpListLink>()); } if (mailCount < notifier.XmlMail.Count) { XmlNode node = notifier.XmlMail[mailCount]; String innerText = node.ChildNodes.Item(0).InnerText; String linkTitle = String.IsNullOrEmpty(innerText) ? Locale.Current.Labels.NoSubject : innerText; String linkUrl = UrlHelper.BuildMailUrl(node.ChildNodes.Item(2).Attributes["href"].Value, notifier.AccountIndex); String path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\Icons"); JumpListLink item = new JumpListLink(linkUrl, linkTitle) { IconReference = new IconReference(Path.Combine(path, "Mail.ico"), 0) }; dictionary[linkText].Add(item); i++; } if (index < (_Instances.Count - 1)) { index++; } else { index = 0; mailCount++; } } foreach (KeyValuePair<string, List<JumpListLink>> pair in dictionary) { JumpListCustomCategory category = new JumpListCustomCategory(pair.Key); category.AddJumpListItems(pair.Value.ToArray()); _JumpList.AddCustomCategories(new JumpListCustomCategory[] { category }); } try { _JumpList.Refresh(); } catch (Exception e) { // https://github.com/shellscape/Gmail-Notifier-Plus/issues/#issue/3 // Unable to remove files to be replaced. (Exception from HRESULT: 0x80070497) Utilities.ErrorHelper.Log(e, Guid.NewGuid()); } }
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); }
/// <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(); } }
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 } }
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) { } }
private void SetUpJumpList( ) { if ( NativeApi.IsWindow7OrLater && NativeApi.IsRecentDocumentTrackingEnabled ( ) ) { var cat = new JumpListCustomCategory ( "Plugins" ); var jumper = Microsoft.WindowsAPICodePack.Taskbar.JumpList.CreateJumpList ( ); string appPath = System.IO.Path.Combine ( Program.LocalPath, "DroidExplorer.Runner.exe" ); foreach ( var item in Settings.Instance.PluginSettings.Plugins ) { IPlugin iplug = Settings.Instance.PluginSettings.GetPlugin ( item.ID.Replace ( " ", string.Empty ) ); if ( item.Enabled && iplug != null && iplug.Runnable ) { JumpListLink jll = new JumpListLink ( appPath, iplug.Text ); jll.Arguments = string.Format ( CultureInfo.InvariantCulture, "/type={0}", item.ID.Replace ( " ", string.Empty ) ); jll.IconReference = new Microsoft.WindowsAPICodePack.Shell.IconReference ( string.Format ( CultureInfo.InvariantCulture, "{0},0", appPath ) ); cat.AddJumpListItems ( jll ); } } jumper.AddCustomCategories ( cat ); jumper.Refresh ( ); } }
/// <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); } }