public static void Initialize() { var devenv = Process.GetCurrentProcess().MainModule.FileName; var presentationMode = new JumpTask { ApplicationPath = devenv, IconResourcePath = devenv, Title = "Presentation Mode", Description = "Starts a separate Visual Studio instance with its own settings, layout, extensions, and more...", Arguments = "/RootSuffix Demo" }; var safeMode = new JumpTask { ApplicationPath = devenv, IconResourcePath = devenv, Title = "Safe Mode", Description = "Starts Visual Studio in limited functionality mode where all extensions are disabled.", Arguments = "/safemode" }; JumpList list = JumpList.GetJumpList(Application.Current) ?? new JumpList(); list.JumpItems.Add(presentationMode); list.JumpItems.Add(safeMode); list.Apply(); }
internal void SwitchToMainMode() { Dispatcher.VerifyAccess(); ExitSlideShow(); if (_viewMode == _WindowMode.Normal) { return; } _viewMode = _WindowMode.Normal; _minimodeWindow.Hide(); _mainWindow.Show(); if (_mainWindow.WindowState == WindowState.Minimized) { _mainWindow.WindowState = WindowState.Normal; } _mainWindow.Activate(); var mainJumpList = (JumpList)Resources["MainModeJumpList"]; JumpList currentJumpList = JumpList.GetJumpList(this); // Remove and replace all tasks. currentJumpList.JumpItems.RemoveAll(item => item.CustomCategory == null); currentJumpList.JumpItems.AddRange(mainJumpList.JumpItems); currentJumpList.Apply(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); // Retrieve the current jump list. var jumpList = new JumpList(); JumpList.SetJumpList(Current, jumpList); // Add a new JumpPath for an application task. var jumpTask = new JumpTask { CustomCategory = "Tasks", Title = "Do Something", ApplicationPath = Assembly.GetExecutingAssembly().Location }; jumpTask.IconResourcePath = jumpTask.ApplicationPath; jumpTask.Arguments = "@#StartOrder"; jumpList.JumpItems.Add(jumpTask); // Update the jump list. jumpList.Apply(); // Load the main window. var win = new Window1(); win.Show(); }
// </snippet240> // <snippet230> private void ClearJumpList(object sender, RoutedEventArgs e) { JumpList jumpList1 = JumpList.GetJumpList(App.Current); jumpList1.JumpItems.Clear(); jumpList1.Apply(); }
private void CreateJumpList() { var applicationPath = Assembly.GetEntryAssembly().Location; var jumpList = new JumpList(); JumpList.SetJumpList(Application.Current, jumpList); var openDatabaseTask = new JumpTask { Title = "Open database", Description = "Open LiteDB v4 database file", ApplicationPath = applicationPath, Arguments = "open" }; jumpList.JumpItems.Add(openDatabaseTask); var newDatabaseTask = new JumpTask { Title = "New database", Description = "Create and open new LiteDB v4 database", ApplicationPath = applicationPath, Arguments = "new" }; jumpList.JumpItems.Add(newDatabaseTask); jumpList.Apply(); }
public static void Apply() { if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 1) { JumpList jumpList = new JumpList(); for (int id = 0; id < Settings.GetInt("Log/JumpLists"); id++) { jumpList.JumpItems.Add(new JumpTask() { ApplicationPath = Application.ExecutablePath + "WvsGame.exe", Title = "Launch Channel " + id.ToString(), Arguments = id.ToString() }); } jumpList.Apply(); if (System.Windows.Application.Current == null) { new System.Windows.Application(); } JumpList.SetJumpList(System.Windows.Application.Current, jumpList); } }
public static void Apply() { if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 1) { JumpList jumpList = new JumpList(); for (int port = 7575; port < 7575 + Settings.GetInt("Log/JumpLists"); port++) { jumpList.JumpItems.Add(new JumpTask() { ApplicationPath = Application.ExecutablePath + "ChannelServer.exe", Title = "Launch on port " + port.ToString(), Arguments = port.ToString() }); } jumpList.Apply(); if (System.Windows.Application.Current == null) { new System.Windows.Application(); } JumpList.SetJumpList(System.Windows.Application.Current, jumpList); } }
public void InitiateJumpList() { if (IS_WINDOWSVISTA() == true) { m_JumpList = new JumpList(); { var jumpItem = new JumpTask(); jumpItem.Title = "Reset Position"; jumpItem.Description = "Resets the window to the center of the primary display."; jumpItem.CustomCategory = ""; jumpItem.ApplicationPath = StaticValues.LauncherExecuteFile; jumpItem.IconResourcePath = StaticValues.LauncherExecuteFile; jumpItem.Arguments = "/ResetWindowPosition"; jumpItem.WorkingDirectory = StaticValues.LauncherWorkDirectory; m_JumpList.JumpItems.Add(jumpItem); } foreach (var launchShortcut in Settings.Instance.ShortcutLaunches) { AddJumpListLaunchCommand(launchShortcut); } System.Windows.Shell.JumpList.SetJumpList(Program.g_LauncherApp, m_JumpList); m_JumpList.Apply(); } }
/// <summary> /// Adds a JumpTask and if needed creates the JumpList /// </summary> /// <param name="game"></param> public void AddTask(Game game) { try { Game g = game.Copy(); g.Name = g.Name.Replace("fav_", ""); // Configure a new JumpTask. JumpTask jumpTask1 = CreateJumpTask(g); // Get the JumpList from the application and update it. if (jumpList == null) { LoadJumpList(); } if (!jumpList.JumpItems.Exists(j => ((JumpTask)j).Title == g.Description)) { jumpList.JumpItems.Insert(0, jumpTask1); SettingsManager.AddGameToJumpList(g.Name); } jumpList.Apply(); } catch (Exception) { //No jump list, we're on XP/Vista } }
/// <summary> /// Pins the jump lists. /// </summary> private void PinJumpLists() { // this is init section JumpList jumpList1 = JumpList.GetJumpList(App.Current); jumpList1.JumpItems.Clear(); // get the config section from app.config file var csvConfigSection = ConfigurationManager.GetSection(StringSplitConfigDataSection.SectionName) as StringSplitConfigDataSection; if (csvConfigSection != null && csvConfigSection.CsvConfigCollection.Count > 0) { foreach (var item in csvConfigSection.CsvConfigCollection) { CSVConfigItem configItem = item as CSVConfigItem; string name = configItem.Name; string fieldArgument = this.GetConcatenatedString(configItem); this.AddJumpListTask(configItem.Name, string.Empty, fieldArgument); } } JumpList jumpList2 = JumpList.GetJumpList(App.Current); jumpList2.Apply(); }
public static void UpdateJumplists() { var iconLibraryPath = ExtractIconLibrary(); var jump = new JumpList(); JumpList.SetJumpList(Application.Current, jump); if (App.AssemblyStorage.AssemblySettings.ApplicationRecents != null) { for (int i = 0; i < 10; i++) { if (i > App.AssemblyStorage.AssemblySettings.ApplicationRecents.Count - 1) { break; } var task = new JumpTask(); int iconIndex = -200; switch (App.AssemblyStorage.AssemblySettings.ApplicationRecents[i].FileType) { case Settings.RecentFileType.Blf: iconIndex = -200; break; case Settings.RecentFileType.Cache: iconIndex = -201; break; case Settings.RecentFileType.MapInfo: iconIndex = -202; break; } task.ApplicationPath = VariousFunctions.GetApplicationAssemblyLocation(); task.Arguments = string.Format("assembly://open \"{0}\"", App.AssemblyStorage.AssemblySettings.ApplicationRecents[i].FilePath); task.WorkingDirectory = VariousFunctions.GetApplicationLocation(); task.IconResourcePath = iconLibraryPath; task.IconResourceIndex = iconIndex; task.CustomCategory = "Recent"; task.Title = App.AssemblyStorage.AssemblySettings.ApplicationRecents[i].FileName + " - " + App.AssemblyStorage.AssemblySettings.ApplicationRecents[i].FileGame; task.Description = string.Format("Open {0} in Assembly. ({1})", App.AssemblyStorage.AssemblySettings.ApplicationRecents[i].FileName, App.AssemblyStorage.AssemblySettings.ApplicationRecents[i].FilePath); jump.JumpItems.Add(task); } } // Show Recent and Frequent categories :D jump.ShowFrequentCategory = false; jump.ShowRecentCategory = false; // Send to the Windows Shell jump.Apply(); }
private void Application_Startup(object sender, StartupEventArgs e) { // Retrieve the current jump list. JumpList jumpList = new JumpList(); JumpList.SetJumpList(Application.Current, jumpList); // Add a new JumpPath for a file in the application folder. string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); path = Path.Combine(path, "readme.txt"); if (File.Exists(path)) { JumpTask jumpTask = new JumpTask(); jumpTask.CustomCategory = "Documentation"; jumpTask.Title = "Read the readme.txt"; jumpTask.ApplicationPath = @"c:\windows\notepad.exe"; jumpTask.IconResourcePath = @"c:\windows\notepad.exe"; jumpTask.Arguments = path; jumpList.JumpItems.Add(jumpTask); } // Update the jump list. jumpList.Apply(); }
private void _OnNotificationsChanged(object sender, NotifyCollectionChangedEventArgs e) { if (ServiceProvider.ViewManager == null || ServiceProvider.ViewManager.Notifications == null) { return; } _currentNotifications.Clear(); var notificationTaskList = new List <JumpItem>(); foreach (Notification notification in from n in ServiceProvider.ViewManager.Notifications orderby n.Created ascending select n) { _currentNotifications.Add(notification); string argument = null; // Get the default URL from the notification. var htc = new HyperlinkTextContent { Text = notification.Title }; Uri notifyUri = htc.DefaultUri; if (notifyUri != null) { argument = "-uri:" + notifyUri.OriginalString; } string title = _GetFirstLine(notification.TitleText); if (title != null) { notificationTaskList.Add(new JumpTask { Arguments = argument, CustomCategory = notification is FriendRequestNotification ? "Friend Requests" : "Notifications", // Shell silently fails to accept multi-line JumpTasks so we need to trim the strings ourselves. Description = _GetFirstLine(notification.DescriptionText), Title = title, }); } } JumpList jumpList = JumpList.GetJumpList(Application.Current); Assert.IsNotNull(jumpList); jumpList.JumpItems.RemoveAll(item => item.CustomCategory == "Notifications"); jumpList.JumpItems.RemoveAll(item => item.CustomCategory == "Friend Requests"); jumpList.JumpItems.AddRange(notificationTaskList); try { jumpList.JumpItemsRemovedByUser += _OnJumpItemsRemovedByUser; jumpList.Apply(); } finally { jumpList.JumpItemsRemovedByUser -= _OnJumpItemsRemovedByUser; } }
/// <summary> /// Creates and/or updates jump list items in the Windows Taskbar for recent sites and tenants. /// </summary> public static void UpdateRecentItemsJumpList() { JumpList list = new JumpList(); list.JumpItemsRemovedByUser += list_JumpItemsRemovedByUser; // Add recent site collections foreach (SiteAuthentication site in Globals.Sites.OrderByDescending(s => s.LoadDate)) { // Define task general parameters JumpTask task = new JumpTask(); task.Title = site.Url.ToString(); task.Description = string.Format("Last opened: {0} {1}\nAuthentication: {2}\nUsername: {3}", site.LoadDate.ToLongDateString(), site.LoadDate.ToShortTimeString(), site.Authentication, site.UserName); task.CustomCategory = CATEGORY_SITES; // TODO: Add icons to TaskBar jump lists //task.IconResourcePath = "SPCB2013.exe"; //task.IconResourceIndex = 1; // Set launch actions task.Arguments = string.Format("-action opensite -url {0}", site.Url); task.WorkingDirectory = Environment.CurrentDirectory; // Add task to jump list list.JumpItems.Add(task); } // Add recent Office 365 Tenants foreach (TenantAuthentication tenant in Globals.Tenants.OrderByDescending(t => t.LoadDate)) { // Define task general parameters JumpTask task = new JumpTask(); task.Title = tenant.AdminUrl.ToString(); task.Description = string.Format("Last opened: {0} {1}\nUsername: {2}", tenant.LoadDate.ToLongDateString(), tenant.LoadDate.ToShortTimeString(), tenant.UserName); task.CustomCategory = CATEGORY_TENANTS; // TODO: Add icons to TaskBar jump lists //task.IconResourcePath = "SPCB2013.exe"; //task.IconResourceIndex = 0; // Set launch actions task.Arguments = string.Format("-action opentenant -url {0}", tenant.AdminUrlAsString); task.WorkingDirectory = Environment.CurrentDirectory; // Add task to jump list list.JumpItems.Add(task); } list.Apply(); }
public void ApplyUpdates() { JumpList jumpList = JumpList.GetJumpList(this.currentApp); if (jumpList == null) { return; } jumpList.Apply(); }
protected virtual IEnumerable <Tuple <JumpItem, JumpItemRejectionReason> > ApplyOverride(JumpList jumpList) { IEnumerable <Tuple <JumpItem, JumpItemRejectionReason> > rejectedItems = null; EventHandler <JumpItemsRejectedEventArgs> onJumpItemsRejectedHandler = (s, e) => rejectedItems = e.RejectedItems.Zip(e.RejectionReasons, (i, r) => new Tuple <JumpItem, JumpItemRejectionReason>(i, r)).ToArray(); jumpList.JumpItemsRejected += onJumpItemsRejectedHandler; jumpList.Apply(); jumpList.JumpItemsRejected -= onJumpItemsRejectedHandler; return(rejectedItems); }
/// <summary> /// Renews all the app's Jump List. /// </summary> /// <param name="connections"></param> public static void RenewJumpList(IEnumerable <ConnectionInfoBase> connections) { var jumpList = new JumpList(); jumpList.BeginInit(); connections.Where(x => x.ShowInJumpList == true) .ToList() .ForEach(x => AddConnectionJumpTask(jumpList, x)); jumpList.EndInit(); jumpList.Apply(); }
private void ApplicationStartup(object sender, StartupEventArgs e) { DoHandleUnexpectedExceptions = true; try { //#if DEBUG //#else AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; //#endif FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); CommonUserSettings.InitializeCommonSettings(ELLO.Properties.Settings.Default); // setup the JumpList features before testing for single application as otherwise the JumpList can be reset JumpList jumpList = JumpList.GetJumpList(Current); JumpTask jt = new JumpTask { Title = "Edit application settings", ApplicationPath = SettingPath(ApplicationName + ".Config", App.ApplicationName), IconResourcePath = @"c:\windows\notepad.exe", Description = "Edit the application configuration file to customise settings", CustomCategory = "Customise" }; jumpList.JumpItems.Add(jt); jt = new JumpTask { Arguments = LogPath(ApplicationName + ".Log"), Title = "Open MotionControlManager log", ApplicationPath = @"c:\windows\notepad.exe", IconResourcePath = @"c:\windows\notepad.exe", Description = "Open the diagnostics log", CustomCategory = "Logging" }; jumpList.JumpItems.Add(jt); jumpList.Apply(); // Create the View Model for the Main Window _mainWindowViewModel = new MainWindowViewModel(e.Args); // Set it as the DataContext for Binding and Commanding _mainWindow = new MainWindow(_mainWindowViewModel); _mainWindow.Show(); Thread.Sleep(500); } catch (Exception ex) { MessageBox.Show("Caught exception: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public static void ClearJumplist() { if (!Win7.IsWin7) { return; } JumpList jumpList = JumpList.GetJumpList(App.Current); jumpList.JumpItems.Clear(); jumpList.Apply(); }
public void ClearJumpList() { JumpList jumpList = JumpList.GetJumpList(this.currentApp); if (jumpList == null) { return; } jumpList.JumpItems.Clear(); jumpList.Apply(); }
private void Application_Startup(object sender, System.Windows.StartupEventArgs e) { JumpList.SetJumpList(App.Current, jumplist); JumpTask jumptask = new JumpTask( ); jumptask.CustomCategory = "任务"; jumptask.Title = "新建窗口"; jumptask.ApplicationPath = AppStartupPath + "\\极简浏览器.exe"; jumptask.IconResourcePath = AppStartupPath + "\\极简浏览器.exe"; jumptask.Arguments = "about:blank false"; jumplist.JumpItems.Add(jumptask); jumplist.Apply( ); }
public void UpdateJumpList() { try { var jumpList = new JumpList(); jumpList.ShowFrequentCategory = false; jumpList.ShowRecentCategory = false; if (AppSettings.QuickLaunchItems > 0) { foreach (var lastGame in QuickLaunchItems) { var args = new CmdLineOptions() { Start = lastGame.Id.ToString() }.ToString(); JumpTask task = new JumpTask { Title = lastGame.Name, Arguments = args, Description = string.Empty, CustomCategory = "Recent", ApplicationPath = PlaynitePaths.DesktopExecutablePath }; if (lastGame.Icon?.EndsWith(".ico", StringComparison.OrdinalIgnoreCase) == true) { task.IconResourcePath = Database.GetFullFilePath(lastGame.Icon); } else if (lastGame.PlayAction?.Type == GameActionType.File) { task.IconResourcePath = lastGame.GetRawExecutablePath(); } jumpList.JumpItems.Add(task); } JumpList.SetJumpList(System.Windows.Application.Current, jumpList); } else { JumpList.SetJumpList(System.Windows.Application.Current, new JumpList()); } jumpList.Apply(); } catch (Exception exc) when(!PlayniteEnvironment.ThrowAllErrors) { logger.Error(exc, "Failed to set jump list data."); } }
public void AddJumpListLaunchCommand(LaunchShortcut _LaunchShortcut) { var jumpItem = new JumpTask(); jumpItem.Title = _LaunchShortcut.ShortcutName; jumpItem.Description = "Launches WoW with the config profile \"" + _LaunchShortcut.Profile + "\" and the realm \"" + _LaunchShortcut.Realm + "\""; jumpItem.CustomCategory = "Launch"; jumpItem.ApplicationPath = StaticValues.LauncherExecuteFile; jumpItem.IconResourcePath = StaticValues.LauncherExecuteFile; jumpItem.Arguments = "/LaunchWoW \"" + _LaunchShortcut.Realm + "\" /ConfigProfile \"" + _LaunchShortcut.Profile + "\""; jumpItem.WorkingDirectory = StaticValues.LauncherWorkDirectory; m_JumpList.JumpItems.Add(jumpItem); m_JumpList.Apply(); }
public CustomJumplist(string newWindowTitle, string newWindowDesc) { JumpItem[] jumpItems = { new JumpTask() { Title = newWindowTitle, Description = newWindowDesc, ApplicationPath = Assembly.GetEntryAssembly().Location, Arguments = "-1", IconResourcePath = "quick-picture-viewer.exe" } }; list = new JumpList(jumpItems, true, true); list.Apply(); }
public CustomJumplist() { JumpItem[] jumpItems = { new JumpTask() { Title = "New window", Description = "Create new QuickPictureViewer window", ApplicationPath = Assembly.GetEntryAssembly().Location, Arguments = "-1", IconResourcePath = "quick-picture-viewer.exe" } }; list = new JumpList(jumpItems, true, true); list.Apply(); }
private static void InitialiseJumpList() { var entryAssembly = Assembly.GetEntryAssembly(); var applicationPath = entryAssembly.Location; var jumpList = new JumpList(); // "I am... Working" var workModeSwitchTask = new JumpTask(); workModeSwitchTask.Title = "Working"; workModeSwitchTask.Description = "Switch to 'Work' mode"; workModeSwitchTask.IconResourceIndex = -1; workModeSwitchTask.CustomCategory = "I am..."; workModeSwitchTask.ApplicationPath = applicationPath; workModeSwitchTask.Arguments = CommandLineCodes.IAmWorking; jumpList.JumpItems.Add(workModeSwitchTask); // "I am... Resting" var restModeSwitchTask = new JumpTask(); restModeSwitchTask.Title = "Resting"; restModeSwitchTask.Description = "Switch to 'Rest' mode"; restModeSwitchTask.IconResourceIndex = -1; restModeSwitchTask.CustomCategory = "I am..."; restModeSwitchTask.ApplicationPath = applicationPath; restModeSwitchTask.Arguments = CommandLineCodes.IAmResting; jumpList.JumpItems.Add(restModeSwitchTask); // "I am... Playing" var playModeSwitchTask = new JumpTask(); playModeSwitchTask.Title = "Playing"; playModeSwitchTask.Description = "Switch to 'Play' mode"; playModeSwitchTask.IconResourceIndex = -1; playModeSwitchTask.CustomCategory = "I am..."; playModeSwitchTask.ApplicationPath = applicationPath; playModeSwitchTask.Arguments = CommandLineCodes.IAmPlaying; jumpList.JumpItems.Add(playModeSwitchTask); // "Exit" var exitTask = new JumpTask(); exitTask.Title = "Exit"; exitTask.Description = "Exit Lazybones"; exitTask.IconResourceIndex = -1; exitTask.ApplicationPath = applicationPath; exitTask.Arguments = "/q"; jumpList.JumpItems.Add(exitTask); jumpList.Apply(); JumpList.SetJumpList(Application.Current, jumpList); }
/// <summary> /// Adds the jump list task for the specified task name /// </summary> /// <param name="taskName">Name of the task.</param> /// <param name="description">The description.</param> /// <param name="argument">The argument.</param> private void AddJumpListTask(string taskName, string description, string argument) { // Configure a new JumpTask. JumpTask jumpTask1 = new JumpTask(); string path = System.Reflection.Assembly.GetExecutingAssembly().Location; jumpTask1.ApplicationPath = path; jumpTask1.Title = taskName; jumpTask1.Description = description; jumpTask1.Arguments = argument; JumpList jumpList1 = JumpList.GetJumpList(App.Current); jumpList1.JumpItems.Add(jumpTask1); JumpList.AddToRecentCategory(jumpTask1); jumpList1.Apply(); }
public static async Task Run() { ViewResolver.Instance.ViewInit(); MangaReader.Core.Client.OtherAppRunning += ClientOnOtherAppRunning; MangaReader.Core.Client.ClientBeenClosed += ClientOnClientBeenClosed; MangaReader.Core.Client.ClientUpdated += ClientOnClientUpdated; // Извлечение текущего списка часто используемых элементов var jumpList = new JumpList(); JumpList.SetJumpList(App.Current, jumpList); // Добавление нового объекта JumpPath для файла в папке приложения var path = System.Reflection.Assembly.GetExecutingAssembly().Location; if (File.Exists(path)) { JumpTask jumpTask = new JumpTask { CustomCategory = "Манга", Title = "Добавить мангу", ApplicationPath = path, IconResourcePath = path, Arguments = AddManga }; jumpList.JumpItems.Add(jumpTask); } // Обновление списка часто используемых элементов jumpList.Apply(); var initialize = new Initialize(); var args = Environment.GetCommandLineArgs(); if (args.Contains("-m") || args.Contains("/min") || ConfigStorage.Instance.AppConfig.StartMinimizedToTray) { await initialize.InitializeSilent().ConfigureAwait(true); WindowModel.Instance.InitializeSilent(); SaveSettingsCommand.ValidateMangaPaths(); } else { initialize.Show(); WindowModel.Instance.Show(); } }
private void FillJumpList() { jumpList.JumpItems.AddRange( from s in Stations from c in s.Value.Channels let channelId = s.Key + ChannelIdSeparator + c.Key where !ignoredChannels.Contains(channelId) select new JumpTask { Title = c.Value.Item1, CustomCategory = "Raidstacijas", ApplicationPath = ExePath, Arguments = channelId, IconResourcePath = s.Value.IconPath, IconResourceIndex = c.Value.Item2 }); jumpList.Apply(); JumpList.SetJumpList(this, jumpList); }
/// <summary> /// Creates the jumplist /// </summary> private void LoadJumpList() { // Get the JumpList from the application and update it. jumpList = new JumpList(); jumpList.ShowRecentCategory = false; JumpList.SetJumpList(System.Windows.Application.Current, jumpList); foreach (string s in Settings.Default.jumplist.Split(',')) { Game game = XmlParser.Games.FindGame(s); if (game != null) { jumpList.JumpItems.Add(CreateJumpTask(game)); } } jumpList.Apply(); }