public void Start() { if (TaskbarManager.IsPlatformSupported) { _eventAggregator.GetEvent <ApplicationArgumentsEvent>().Subscribe(OnArgumentsReceived, ThreadOption.UIThread, true); _jumpList = new JumpList(); _tileService.Tiles.ForEach(AddJumpTask); _tileService.TileAdded += (sender, args) => AddJumpTask(args.Tile); JumpList.SetJumpList(Application.Current, _jumpList); _radio.CurrentTrackChanged += RadioOnCurrentTrackChanged; _player.IsPlayingChanged += PlayerOnIsPlayingChanged; if (Application.Current.MainWindow.IsLoaded) { InitializeTaskBarButtons(); } else { Application.Current.MainWindow.Loaded += delegate { InitializeTaskBarButtons(); }; } } }
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(); }
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(); }