private void CreateJumpList() { if (!TaskbarManager.IsPlatformSupported) { return; } 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(); }
private void CreateJumpList() { JumpList jumpList = new JumpList(); //jumpList.ShowRecentCategory = true; JumpList.SetJumpList(Application.Current, jumpList); string[] projects = Gibbo.Editor.WPF.Properties.Settings.Default.LastLoadedProjects.Split('|'); int c = 0; foreach (string path in projects) { if (path.Trim() != string.Empty && File.Exists(path)) { JumpTask task = new JumpTask(); task.CustomCategory = "Recent"; task.Title = System.IO.Path.GetFileNameWithoutExtension(path); task.Description = task.Title + " (" + path.Split('.')[0] + ")"; task.ApplicationPath = path; jumpList.JumpItems.Add(task); //JumpList.AddToRecentCategory(task); c++; if (c == 8) break; } } jumpList.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(); }
public static void CreateJumpList() { var jumpList = new JumpList(); JumpList.SetJumpList(Application.Current, jumpList); var restartTask = new JumpTask { Title = Resources.MainWindow_CreateJumpList_Start_New_Session, Description = Resources.MainWindow_CreateJumpList_Starts_a_new_Pomodoro_session_, ApplicationPath = Assembly.GetEntryAssembly().Location, Arguments = "/restart", IconResourcePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/Pomodoro.Icons.dll", IconResourceIndex = 0 }; jumpList.JumpItems.Add(restartTask); /* * var startTask = new JumpTask * { * Title = Resources.MainWindow_CreateJumpList_Start_Timer, * Description = Resources.MainWindow_CreateJumpList_Starts_the_timer_if_it_is_stopped_, * ApplicationPath = Assembly.GetEntryAssembly().Location, * Arguments = "/start", * IconResourcePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/Pomodoro.Icons.dll", * IconResourceIndex = 0 * }; * jumpList.JumpItems.Add(startTask); * var stopTask = new JumpTask * { * Title = Resources.MainWindow_CreateJumpList_Stop_Timer, * Description = Resources.MainWindow_CreateJumpList_Stops_the_timer_if_it_is_started_, * ApplicationPath = Assembly.GetEntryAssembly().Location, * Arguments = "/stop", * IconResourcePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/Pomodoro.Icons.dll", * IconResourceIndex = 0 * }; * jumpList.JumpItems.Add(stopTask); * var stopRingingTask = new JumpTask * { * Title = Resources.MainWindow_CreateJumpList_Stop_Ringing, * Description = Resources.MainWindow_CreateJumpList_Mutes_a_ringing_timer_and_prepares_for_a_new_session, * ApplicationPath = Assembly.GetEntryAssembly().Location, * Arguments = "/stopringing", * IconResourcePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/Pomodoro.Icons.dll", * IconResourceIndex = 0 * }; * jumpList.JumpItems.Add(stopRingingTask); */ jumpList.Apply(); }
private void AddJumpTask(Tile tile) { Application.Current.Dispatcher.BeginInvoke( new Action <Tile>(t => { UriQuery q = new UriQuery(); q.Add("ViewId", t.NavigationUri.OriginalString); q.Add("RegionId", t.TargetRegionName); JumpTask task = new JumpTask(); task.Title = t.Data.Title; task.Arguments = q.ToString(); _jumpList.JumpItems.Add(task); _jumpList.Apply(); }), DispatcherPriority.ContextIdle, tile); }
public Startup() { var jumpList = new JumpList(); JumpList.SetJumpList(Current, jumpList); // todo: configure jump list //JumpTask t; //jumpList.JumpItems.Add(new JumpTask() // { // Title = "netCDS Wing", // CustomCategory = "Recent Rooms" // }); //jumpList.JumpItems.Add(new JumpTask() //{ // Title = "netCDS Wing", // CustomCategory = "Recent Rooms" //}); jumpList.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(); }
protected override void OnStartup(System.Windows.StartupEventArgs e) { base.OnStartup(e); // Retrieve the current jump list. JumpList jumpList = new JumpList(); JumpList.SetJumpList(Application.Current, jumpList); // Add a new JumpPath for an application task. JumpTask jumpTask = new JumpTask(); jumpTask.CustomCategory = "Tasks"; jumpTask.Title = "Do Something"; jumpTask.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. Window1 win = new Window1(); win.Show(); }
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); }
private void Application_Startup(object sender, StartupEventArgs e) { // Извлечение текущего списка часто используемых элементов JumpList jumpList = new JumpList(); JumpList.SetJumpList(Application.Current, jumpList); // Добавление нового объекта JumpPath для файла в папке приложения string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); path = Path.Combine(path, "lol.xml"); if (File.Exists(path)) { JumpTask jumpTask = new JumpTask(); jumpTask.CustomCategory = "Documentation"; jumpTask.Title = "Read the lol.xml"; jumpTask.ApplicationPath = @"C:\Program Files\Notepad++\notepad++.exe"; jumpTask.IconResourcePath = @"C:\Program Files\Notepad++\notepad++.exe"; jumpTask.Arguments = path; jumpList.JumpItems.Add(jumpTask); } // Обновление списка часто используемых элементов jumpList.Apply(); }
protected override void OnStartup(StartupEventArgs e) { splashScreen = new SplashScreen("Images/splashScreen.png"); splashScreen.Show(false, false); var jumpList = new JumpList(); jumpList.ShowFrequentCategory = false; jumpList.ShowRecentCategory = false; var appLocation = Assembly.GetExecutingAssembly().Location; var iconsFolder = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(appLocation), "Images", "Icons"); jumpList.JumpItems.Add ( new JumpTask() { Title = "Open dashboard", Description = "Open dashboard", ApplicationPath = appLocation, CustomCategory = "NFC Control Center", Arguments = "NFCAccessControlCenter.Go.Dashboard", IconResourcePath = System.IO.Path.Combine(iconsFolder, "dashboard.ico") } ); jumpList.JumpItems.Add ( new JumpTask() { Title = "Open user control", Description = "Open user control", ApplicationPath = appLocation, CustomCategory = "NFC Control Center", Arguments = "NFCAccessControlCenter.Go.UserControl", IconResourcePath = System.IO.Path.Combine(iconsFolder, "usercontrol.ico") } ); jumpList.JumpItems.Add ( new JumpTask() { Title = "Open nfc tag control", Description = "Open nfc tag control", ApplicationPath = appLocation, CustomCategory = "NFC Control Center", Arguments = "NFCAccessControlCenter.Go.NFCTag", IconResourcePath = System.IO.Path.Combine(iconsFolder, "nfctag.ico") } ); jumpList.JumpItems.Add ( new JumpTask() { Title = "Open access control", Description = "Open access control", ApplicationPath = appLocation, CustomCategory = "NFC Control Center", Arguments = "NFCAccessControlCenter.Go.AccessControlView", IconResourcePath = System.IO.Path.Combine(iconsFolder, "accessgroups.ico") } ); jumpList.JumpItems.Add ( new JumpTask() { Title = "Open settings", Description = "Open settings", ApplicationPath = appLocation, CustomCategory = "NFC Control Center", Arguments = "NFCAccessControlCenter.Go.Settings", IconResourcePath = System.IO.Path.Combine(iconsFolder, "settings.ico") } ); jumpList.Apply(); base.OnStartup(e); StartMainApp(e.Args); splashScreen.Close(TimeSpan.FromMilliseconds(500)); }
private void UpdateJumpList() { var jumpList = new JumpList(); JumpList.SetJumpList(Application.Current, jumpList); foreach (var applicationLink in ApplicationLinks) { var jumpTask = new JumpTask() { CustomCategory = "Applications", Title = applicationLink.Title, Arguments = applicationLink.GetHashCode().ToString(CultureInfo.InvariantCulture), ApplicationPath = Assembly.GetEntryAssembly().Location }; string directoryName = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName; if (string.IsNullOrWhiteSpace(directoryName) == false) { jumpTask.IconResourcePath = Path.Combine(directoryName, "resources\\connect.ico"); } jumpList.JumpItems.Add(jumpTask); } jumpList.Apply(); }
protected override void OnStartup(StartupEventArgs e) { // Splasher.Splash = new SplashScreenWindow(); // Splasher.ShowSplash(); #if DEBUG // Control.CheckForIllegalCrossThreadCalls = true; #endif if (!CheckEnvironment()) return; if (!SingleInstance<App>.InitializeAsFirstInstance(Unique)) return; // Application = new App(); // Application.InitializeComponent(); // Application.Run(); // var _tools = Workspace.Instance.Tools; // foreach (var tool in _tools) // { // if (tool is miRobotEditor.GUI.FindReplaceViewModel) // { // var obj = tool as miRobotEditor.GUI.FindReplaceViewModel; // System.Xml.Serialization.XmlSerializer serial = new System.Xml.Serialization.XmlSerializer(typeof(miRobotEditor.GUI.Results)); // System.IO.TextWriter writer = new System.IO.StreamWriter("D:\\results.xml"); // serial.Serialize(writer,obj.FindReplaceResults); // } // } // Allow single instance code to perform cleanup operations SingleInstance<App>.Cleanup(); if (e.Args.Length > 0) { foreach (var v in e.Args) { Console.WriteLine(v); } } var task = new JumpTask { Title = "Check for Updates", Arguments = "/update", Description = "Checks for Software Updates", CustomCategory = "Actions", IconResourcePath = Assembly.GetEntryAssembly().CodeBase, ApplicationPath = Assembly.GetEntryAssembly().CodeBase }; var asm = Assembly.GetExecutingAssembly(); var version = new JumpTask { CustomCategory = "Version", Title = asm.GetName().Version.ToString(), IconResourcePath = asm.Location, IconResourceIndex = 0 }; var jumpList = new JumpList(); jumpList.JumpItems.Add(version); jumpList.ShowFrequentCategory = true; jumpList.ShowRecentCategory = true; JumpList.SetJumpList(Current, jumpList); jumpList.Apply(); base.OnStartup(e); }
/// <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(); }