public static async Task <JumpList> LoadJumpListAsync() { var jumpList = await JumpList.LoadCurrentAsync(); var items = (from a in jumpList.Items where a.Arguments.StartsWith("as-music") select a).ToList(); foreach (var j in items) { jumpList.Items.Remove(j); } for (int i = 0; i < args.Length; i++) { if (args[i].Contains("action")) { jumpList.Items.Add(CreateItem(args[i], Consts.Localizer.GetString(displays[i]), Consts.Localizer.GetString(groups[1]), Consts.Localizer.GetString(displays[i]), new Uri(pics[i]))); } else { jumpList.Items.Add(CreateItem(args[i], Consts.Localizer.GetString(displays[i]), Consts.Localizer.GetString(groups[0]), Consts.Localizer.GetString(displays[i]), new Uri(pics[i]))); } } return(jumpList); }
private async void SystemGroup_None_Click(object sender, RoutedEventArgs e) { var jumpList = await JumpList.LoadCurrentAsync(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; await jumpList.SaveAsync(); }
/// <summary> /// Creates a JumpList for the given application instance. /// It also adds thumbnail toolbars, which are a set of up to seven buttons at the bottom of the taskbar’s icon thumbnail preview. /// </summary> /// <param name="windowHandle">The application instance's main window handle.</param> /// <param name="buttons">The thumbnail toolbar buttons to be added.</param> public void CreateJumpList(IntPtr windowHandle, WindowsThumbnailToolbarButtons buttons) { if (ToolbarButtonsCreated || !IsSupported || windowHandle == IntPtr.Zero) { return; } SafeInvoke(() => { // One ApplicationId, so all windows must share the same jumplist var jumpList = JumpList.CreateJumpList(); jumpList.ClearAllUserTasks(); jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent; jumpList.Refresh(); CreateTaskbarButtons(windowHandle, buttons); }, nameof(CreateJumpList)); return; void CreateTaskbarButtons(IntPtr handle, WindowsThumbnailToolbarButtons thumbButtons) { _commitButton = new ThumbnailToolBarButton(MakeIcon(thumbButtons.Commit.Image, 48, true), thumbButtons.Commit.Text); _commitButton.Click += thumbButtons.Commit.Click; _pushButton = new ThumbnailToolBarButton(MakeIcon(thumbButtons.Push.Image, 48, true), thumbButtons.Push.Text); _pushButton.Click += thumbButtons.Push.Click; _pullButton = new ThumbnailToolBarButton(MakeIcon(thumbButtons.Pull.Image, 48, true), thumbButtons.Pull.Text); _pullButton.Click += thumbButtons.Pull.Click; // Call this method using reflection. This is a workaround to *not* reference WPF libraries, becuase of how the WindowsAPICodePack was implimented. TaskbarManager.Instance.ThumbnailToolBars.AddButtons(handle, _commitButton, _pullButton, _pushButton); } }
private static List <JumpList._ShellObjectPair> GenerateJumpItems(IObjectArray shellObjects) { List <JumpList._ShellObjectPair> list = new List <JumpList._ShellObjectPair>(); Guid guid = new Guid("00000000-0000-0000-C000-000000000046"); uint count = shellObjects.GetCount(); for (uint num = 0u; num < count; num += 1u) { object at = shellObjects.GetAt(num, ref guid); JumpItem jumpItem = null; try { jumpItem = JumpList.GetJumpItemForShellObject(at); } catch (Exception ex) { if (ex is NullReferenceException || ex is SEHException) { throw; } } list.Add(new JumpList._ShellObjectPair { ShellObject = at, JumpItem = jumpItem }); } return(list); }
public void UpdateJumpList() { OnPropertyChanged("LastGames"); var jumpList = new JumpList(); foreach (var lastGame in LastGames) { JumpTask task = new JumpTask { Title = lastGame.Name, Arguments = "-command launch:" + lastGame.Id, Description = string.Empty, CustomCategory = "Recent", ApplicationPath = Paths.ExecutablePath }; if (lastGame.PlayTask != null && lastGame.PlayTask.Type == GameTaskType.File) { if (string.IsNullOrEmpty(lastGame.PlayTask.WorkingDir)) { task.IconResourcePath = lastGame.PlayTask.Path; } else { task.IconResourcePath = Path.Combine(lastGame.PlayTask.WorkingDir, lastGame.PlayTask.Path); } } jumpList.JumpItems.Add(task); jumpList.ShowFrequentCategory = false; jumpList.ShowRecentCategory = false; } JumpList.SetJumpList(Application.Current, jumpList); }
/// <summary> /// Clears and re-creates all custom items in the app's jump list. /// </summary> public async Task RefreshJumpList() { if (!JumpList.IsSupported()) { return; } try { JumpList jumpList = await JumpList.LoadCurrentAsync(); jumpList.Items.Clear(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; string packageId = Package.Current.Id.Name; foreach (string color in new[] { "Blue", "Green", "Red", "Yellow" }) { var item = JumpListItem.CreateWithArguments(color, $"ms-resource://{packageId}/Resources/{color}NavItem/Content"); item.GroupName = $"ms-resource://{packageId}/Resources/JumpListGroupColors"; item.Logo = new Uri($"ms-appx:///Assets/JumpList/{color}.png"); jumpList.Items.Add(item); } await jumpList.SaveAsync(); } catch (Exception ex) { // TODO: Proper error handling. SaveAsync may fail, for example with exception // "Unable to remove the file to be replaced." (Exception from HRESULT 0x80070497) Debug.WriteLine(ex); } }
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(); }
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) { } }
void refreshJumlist() { JumpList jumpList = JumpList.CreateJumpListForIndividualWindow(TaskbarManager.Instance.ApplicationId, this.Handle); List <GroupModel> groups = new List <GroupModel>(groupMapping.Values); foreach (var group in groups) { string groupName = group.Name; JumpListCustomCategory category = new JumpListCustomCategory(groupName); List <ItemModel> items = new List <ItemModel>(group.Items.Values); foreach (var item in items) { string itemName = item.Name; string itemPath = item.Url; JumpListLink jll = new JumpListLink(itemPath, itemName); jll.IconReference = new IconReference(itemPath.ToString(), 0); category.AddJumpListItems(jll); } jumpList.AddCustomCategories(category); } jumpList.Refresh(); }
public static void CreateJumpList() { JumpTask update = new JumpTask() { Title = "Check for Updates", Arguments = "/update", Description = "Cheks for Software Updates", CustomCategory = "Actions", IconResourcePath = Assembly.GetEntryAssembly().CodeBase, ApplicationPath = Assembly.GetEntryAssembly().CodeBase }; JumpTask restart = new JumpTask() { Title = "Restart on default monitor", Arguments = "/firstmonitor", Description = "Restarts the application on the first monitor", CustomCategory = "Actions", IconResourcePath = Assembly.GetEntryAssembly().CodeBase, ApplicationPath = Assembly.GetEntryAssembly().CodeBase }; var appmenu = new JumpList(); appmenu.JumpItems.Add(update); appmenu.JumpItems.Add(restart); appmenu.ShowFrequentCategory = false; appmenu.ShowRecentCategory = false; JumpList.SetJumpList(Application.Current, appmenu); }
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(); }
public static void Init() { var jumpList1 = new JumpList { ShowRecentCategory = true, ShowFrequentCategory = true, }; //jumpList1.JumpItemsRejected += JumpList1_JumpItemsRejected; //jumpList1.JumpItemsRemovedByUser += JumpList1_JumpItemsRemovedByUser; jumpList1.JumpItems.Add(new JumpTask { Title = "Notepad", Description = "Open Notepad.", ApplicationPath = @"C:\Windows\notepad.exe", IconResourcePath = @"C:\Windows\notepad.exe", }); jumpList1.JumpItems.Add(new JumpTask { Title = "Read Me", Description = "Open readme.txt in Notepad.", ApplicationPath = @"C:\Windows\notepad.exe", IconResourcePath = @"C:\Windows\System32\imageres.dll", IconResourceIndex = 14, WorkingDirectory = @"C:\Users\Public\Documents", Arguments = "readme.txt", }); JumpList.SetJumpList(AvaloniaApplication.Current, jumpList1); }
internal void CreateJumpList() { if (CoreHelpers.RunningOnWin7) { string cmdPath = Assembly.GetEntryAssembly().Location; JumpList jumpList = JumpList.CreateJumpList(); JumpListCustomCategory category = new JumpListCustomCategory("Status Change"); category.AddJumpListItems( new JumpListLink(cmdPath, Status.Online.ToString()) { Arguments = Status.Online.ToString() }, new JumpListLink(cmdPath, Status.Away.ToString()) { Arguments = Status.Away.ToString() }, new JumpListLink(cmdPath, Status.Busy.ToString()) { Arguments = Status.Busy.ToString() }); jumpList.AddCustomCategories(category); jumpList.Refresh(); } }
public static async Task InitializeAsync() { if (!ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList")) { return; } try { JumpList jumpList = await JumpList.LoadCurrentAsync(); jumpList.Items.Clear(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; var listItemAddPayment = JumpListItem.CreateWithArguments(AppConstants.AddPaymentId, Strings.AddPaymentLabel); listItemAddPayment.Logo = new Uri(INCOME_ICON); jumpList.Items.Add(listItemAddPayment); await jumpList.SaveAsync(); } catch (Exception ex) { logger.Warn(ex); } }
private async Task UpdateJumpList() { if (!JumpList.IsSupported()) { return; } try { JumpList jumpList = await JumpList.LoadCurrentAsync(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; jumpList.Items.Clear(); foreach (DirectionViewModel directionViewModel in AvailableDirections) { string itemName = string.Format("{0} → {1}", directionViewModel.OriginLanguage, directionViewModel.DestinationLanguage); string arguments = "dict:" + directionViewModel.OriginLanguageCode + directionViewModel.DestinationLanguageCode; JumpListItem jumpListItem = JumpListItem.CreateWithArguments(arguments, itemName); jumpListItem.Logo = LanguageCodes.GetCountryFlagUri(directionViewModel.OriginLanguageCode); jumpList.Items.Add(jumpListItem); } await jumpList.SaveAsync(); } catch { // in rare cases, SaveAsync may fail with HRESULT 0x80070497: "Unable to remove the file to be replaced." // this appears to be a common problem without a solution, so we simply ignore any errors here } }
public bool LoadController(string filename = null) { if (TLCGenControllerDataProvider.Default.OpenController(filename)) { string lastfilename = TLCGenControllerDataProvider.Default.ControllerFileName; SetControllerForStatics(TLCGenControllerDataProvider.Default.Controller); ControllerVM.Controller = TLCGenControllerDataProvider.Default.Controller; Messenger.Default.Send(new ControllerFileNameChangedMessage(TLCGenControllerDataProvider.Default.ControllerFileName, lastfilename)); Messenger.Default.Send(new UpdateTabsEnabledMessage()); RaisePropertyChanged("ProgramTitle"); RaisePropertyChanged("HasController"); FileOpened?.Invoke(this, TLCGenControllerDataProvider.Default.ControllerFileName); var jumpTask = new JumpTask { Title = Path.GetFileName(TLCGenControllerDataProvider.Default.ControllerFileName), Arguments = TLCGenControllerDataProvider.Default.ControllerFileName }; JumpList.AddToRecentCategory(jumpTask); return(true); } if (filename != null) { FileOpenFailed?.Invoke(this, filename); } return(false); }
private async Task SetupJumpList() { try { var calculatorOptions = NavCategoryGroup.CreateCalculatorCategory(); var jumpList = await JumpList.LoadCurrentAsync(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; jumpList.Items.Clear(); foreach (NavCategory option in calculatorOptions.Categories) { if (!option.IsEnabled) { continue; } ViewMode mode = option.Mode; var item = JumpListItem.CreateWithArguments(((int)mode).ToString(), "ms-resource:///Resources/" + NavCategory.GetNameResourceKey(mode)); item.Description = "ms-resource:///Resources/" + NavCategory.GetNameResourceKey(mode); item.Logo = new Uri("ms-appx:///Assets/" + mode.ToString() + ".png"); jumpList.Items.Add(item); } await jumpList.SaveAsync(); } catch { } }
public void Create(params string[] lines) { _textBuffer = EditorUtil.CreateTextBuffer(lines); _trackingLineColumnService = new TrackingLineColumnService(); _jumpListRaw = new JumpList(_trackingLineColumnService); _jumpList = _jumpListRaw; }
internal static void RefreshJumpList(IntPtr handle, string shortcutsFolder, bool refreshOnTop) { JumpList jumpList = JumpList.CreateJumpListForIndividualWindow(TaskbarManager.Instance.ApplicationId, handle); if (refreshOnTop) { jumpList.AddUserTasks(new JumpListLink(Application.ExecutablePath, "Refresh jump list") { Arguments = BuildCommand("--dir", shortcutsFolder, "--refresh", "--pinned"), WorkingDirectory = Directory.GetCurrentDirectory(), }); jumpList.AddUserTasks(new JumpListSeparator()); } jumpList.AddUserTasks(ShortcutsToLinks(shortcutsFolder).ToArray()); if (!refreshOnTop) { jumpList.AddUserTasks(new JumpListSeparator()); jumpList.AddUserTasks(new JumpListLink(Application.ExecutablePath, "Refresh jump list") { Arguments = BuildCommand("--dir", shortcutsFolder, "--refresh", "--pinned", "--bottom"), WorkingDirectory = Directory.GetCurrentDirectory(), }); } jumpList.Refresh(); }
public ContinuousSecurityList(StudioEntityRegistry registry) { _registry = registry; _jumps = new JumpList(_registry.Storage) { BulkLoad = true }; foreach (var group in _jumps.GroupBy(j => j.Id.ContinuousSecurity)) { group.ForEach(s => s.Id.JumpSecurity.CheckExchange()); var underlyingSecurity = group.First().Id.JumpSecurity; var cs = new ContinuousSecurity { Id = group.Key, Board = underlyingSecurity.Board, Type = underlyingSecurity.Type, PriceStep = underlyingSecurity.PriceStep, ExtensionInfo = new Dictionary <object, object>(), }; cs.ExpirationJumps.AddRange(group.Select(j => new KeyValuePair <Security, DateTimeOffset>(j.Id.JumpSecurity, j.JumpDate))); Add(cs); } }
private async void LoadJumplist() { await System.Threading.Tasks.Task.Delay(5000); JumpList jl = JumpList.CreateJumpList(); JumpListCustomCategory jlc = new JumpListCustomCategory("µVoice Alpha (Private Build)"); JumpListLink[] jli = new JumpListLink[] { new JumpListLink("report", "Reportar Un Problema"), new JumpListLink("reports", "Decirle a bit que es mierda."), new JumpListLink("update", "Buscar Actualizaciones") }; jlc.AddJumpListItems(jli); jl.AddCustomCategories(jlc); jl.Refresh(); TaskbarManager.Instance.TabbedThumbnail.SetThumbnailClip(new WindowInteropHelper(this).Handle, new System.Drawing.Rectangle(10, 64, Convert.ToInt32(mainpiano.ActualWidth), Convert.ToInt32(mainpiano.ActualHeight))); TabbedThumbnail preview = new TabbedThumbnail(this, mainpiano, new System.Windows.Vector(10000, 10000)); preview.SetWindowIcon(Properties.Resources.icon); preview.Title = this.Title; try { TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview); } catch { } RenderTargetBitmap rtb = new RenderTargetBitmap((int)play.ActualWidth, (int)play.ActualHeight, 96, 96, PixelFormats.Pbgra32); rtb.Render(play); MemoryStream stream = new MemoryStream(); BitmapEncoder encoder = new BmpBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(rtb)); encoder.Save(stream); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(stream); TaskbarManager.Instance.ThumbnailToolBars.AddButtons(mainpiano, new ThumbnailToolBarButton[] { new ThumbnailToolBarButton(System.Drawing.Icon.FromHandle(bmp.GetHicon()), "Play") }); }
//-------------------------------------------------------------------------------------------------- public void AddToMruList(string filePath) { var index = MruList.IndexOfFirst(s => s.CompareIgnoreCase(filePath) == 0); if (index >= 0) { // Move to top of list MruList.Move(index, 0); MruList[0] = filePath; } else { if (MruList.Count >= _MaxMruCount) { MruList.RemoveAt(MruList.Count - 1); } MruList.Insert(0, filePath); } InteractiveContext.Current.SaveLocalSettings("MRU", MruList); try { JumpList.AddToRecentCategory(filePath); } catch { // ignored } }
public static async Task UpdateAsync(ISettingsService settingsService) { if (!JumpList.IsSupported()) { return; } try { var jumpList = await JumpList.LoadCurrentAsync(); jumpList.Items.Clear(); foreach (var profile in settingsService.GetAllProfiles()) { var item = JumpListItem.CreateWithArguments(ShellProfileFlag + profile.Id, profile.Name); item.Description = profile.Location; jumpList.Items.Add(item); } await jumpList.SaveAsync(); } catch (Exception e) { Logger.Instance.Error(e, "JumpList Update Exception"); } }
private static async Task InitializeAppComponentsAsync() { var userSettingsService = Ioc.Default.GetRequiredService <IUserSettingsService>(); var appearanceSettingsService = userSettingsService.AppearanceSettingsService; // Start off a list of tasks we need to run before we can continue startup await Task.Run(async() => { await Task.WhenAll( StartAppCenter(), DrivesManager.UpdateDrivesAsync(), OptionalTask(CloudDrivesManager.UpdateDrivesAsync(), appearanceSettingsService.ShowCloudDrivesSection), LibraryManager.UpdateLibrariesAsync(), OptionalTask(NetworkDrivesManager.UpdateDrivesAsync(), appearanceSettingsService.ShowNetworkDrivesSection), OptionalTask(WSLDistroManager.UpdateDrivesAsync(), appearanceSettingsService.ShowWslSection), OptionalTask(FileTagsManager.UpdateFileTagsAsync(), appearanceSettingsService.ShowFileTagsSection), SidebarPinnedController.InitializeAsync() ); await Task.WhenAll( AppSettings.DetectQuickLook(), TerminalController.InitializeAsync(), JumpList.InitializeAsync(), ExternalResourcesHelper.LoadOtherThemesAsync(), ContextFlyoutItemHelper.CachedNewContextMenuEntries ); userSettingsService.ReportToAppCenter(); }); // Check for required updates var updateService = Ioc.Default.GetRequiredService <IUpdateService>(); await updateService.CheckForUpdates(); await updateService.DownloadMandatoryUpdates();
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(); }
/// <summary> /// creates windows jumplist /// </summary> private void CreateJumpList() { JumpList jl = new JumpList(); JumpTask jt = new JumpTask(); jt.Title = "Hauptfenster"; jt.Description = "Hauptfenster"; jt.Arguments = "SHOWWINDOW"; jt.ApplicationPath = Assembly.GetEntryAssembly().CodeBase; jt.IconResourcePath = Assembly.GetEntryAssembly().CodeBase; jl.JumpItems.Add(jt); foreach (RDPFunctions.RDPConnection item in connections.ConnectionList) { jt = new JumpTask(); //jt.IconResourcePath = AppDomain.CurrentDomain.BaseDirectory + "\\Icons.dll"; jt.Title = item.Name; jt.Description = item.Host; jt.Arguments = string.Format("\"{0}\"", item.Name); jt.CustomCategory = item.Group; jt.ApplicationPath = Assembly.GetEntryAssembly().CodeBase; jt.IconResourcePath = Assembly.GetEntryAssembly().CodeBase; jl.JumpItems.Add(jt); } JumpList.SetJumpList(Application.Current, jl); //jl.Apply(); }
public void PlayStation(Station station) { CurrentStation = station; JumpList.AddToRecentCategory(station.asJumpTask()); RunTask(PlayThread); }
public static async Task CreateDefaultList(bool clear = false) { if (JumpList.IsSupported()) { var jumplist = await JumpList.LoadCurrentAsync(); if (!jumplist.Items.Any() || clear) { jumplist.Items.Clear(); var args = new ToastNotificationArgs() { type = "jumplist", openBookmarks = true }; var item = JumpListItem.CreateWithArguments(JsonConvert.SerializeObject(args), "Open Bookmarks"); item.Logo = new Uri("ms-appx:///Assets/BadgeLogo.scale-100.png"); args.openBookmarks = false; args.openPrivateMessages = true; var item2 = JumpListItem.CreateWithArguments(JsonConvert.SerializeObject(args), "Open Private Messages"); item2.Logo = new Uri("ms-appx:///Assets/BadgeLogo.scale-100.png"); jumplist.Items.Add(item); jumplist.Items.Add(item2); var seperate = JumpListItem.CreateSeparator(); jumplist.Items.Add(seperate); await jumplist.SaveAsync(); } } }
protected override void OnContentRendered(EventArgs e) { base.OnContentRendered(e); // Disable the minimize button var hWnd = new WindowInteropHelper(this).Handle; var windowLong = GetWindowLong(hWnd, GWL_STYLE); windowLong = windowLong & ~WS_MAXIMIZEBOX; SetWindowLong(hWnd, GWL_STYLE, windowLong); _jumpList = JumpList.CreateJumpList(); _jumpList.Refresh(); var systemFolder = Environment.GetFolderPath(Environment.SpecialFolder.System); _jumpList.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "taskmgr.exe"), "Open Task Manager") { IconReference = new IconReference(Path.Combine(systemFolder, "taskmgr.exe"), 0) }); _jumpList.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "perfmon.exe"), "Open Resource Monitor") { IconReference = new IconReference(Path.Combine(systemFolder, "perfmon.exe"), 0), Arguments = "/res" }); _jumpList.Refresh(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); // Create a jump-list and assign it to the current application JumpList.SetJumpList(Application.Current, new JumpList()); // Check that there is only one instance of the application running bool isNewInstance = false; instanceMutex = new Mutex(true, string.Format("{0}-{1}", ProductInformation.ApplicationGuid, ProcessExecutable.AssemblyVersion()), out isNewInstance); // Process the command-line arguments this.ProcessCommandLineArguments(isNewInstance); if (isNewInstance) { instanceMutex.ReleaseMutex(); this.ExecuteStartup(); } else { LogClient.Warning("{0} is already running. Shutting down.", ProductInformation.ApplicationDisplayName); this.Shutdown(); } }
/// <summary> /// Einträge in der JumpList (Aufgaben) des Tasks erzeugen /// 1. Notizen - StikyNot.exe /// 2. Snipping - Snipping.exe /// 3. Notepad - Notepad.exe /// </summary> void createTaksJumpList() { CustomJumpList = JumpList.CreateJumpList(); CustomJumpList.ClearAllUserTasks(); JumpListLink EntryNote = new JumpListLink(@"%windir%\system32\StikyNot.exe", "Notizen"); EntryNote.IconReference = new IconReference(@"%windir%\system32\StikyNot.exe", 0); CustomJumpList.AddUserTasks(EntryNote); JumpListLink EntrySnipp = new JumpListLink(@"%windir%\system32\SnippingTool.exe", "Snipping"); EntrySnipp.IconReference = new IconReference(@"%windir%\system32\SnippingTool.exe", 0); CustomJumpList.AddUserTasks(EntrySnipp); JumpListLink EntryNotepad = new JumpListLink(@"%windir%\system32\Notepad.exe", "Notepad"); EntryNotepad.IconReference = new IconReference(@"%windir%\system32\Notepad.exe", 0); CustomJumpList.AddUserTasks(EntryNotepad); JumpListLink EntryCmd = new JumpListLink(@"%windir%\system32\cmd.exe", "Eingabeaufforderung"); EntryCmd.IconReference = new IconReference(@"%windir%\system32\cmd.exe", 0); CustomJumpList.AddUserTasks(EntryCmd); if (!string.IsNullOrWhiteSpace(strTCmdPath)) { JumpListLink EntryTCM = new JumpListLink(strTCmdPath, "Total Commander - " + strTCmdVersion); EntryTCM.IconReference = new IconReference(strTCmdPath, 0); CustomJumpList.AddUserTasks(EntryTCM); } CustomJumpList.Refresh(); }
public void Create(params string[] lines) { var textView = CreateTextView(lines); _textBuffer = textView.TextBuffer; _bufferTrackingService = new BufferTrackingService(); _jumpListRaw = new JumpList(textView, _bufferTrackingService); _jumpList = _jumpListRaw; }
internal static ICommonOperations CreateCommonOperations( ITextView textView, IVimLocalSettings localSettings, IOutliningManager outlining = null, IStatusUtil statusUtil = null, ISearchService searchService = null, IUndoRedoOperations undoRedoOperations = null, IVimData vimData = null, IVimHost vimHost = null, ITextStructureNavigator navigator = null, IClipboardDevice clipboardDevice = null, IFoldManager foldManager = null) { var editorOperations = EditorUtil.GetOperations(textView); var editorOptions = EditorUtil.FactoryService.EditorOptionsFactory.GetOptions(textView); var jumpList = new JumpList(new TrackingLineColumnService()); var keyMap = new KeyMap(); foldManager = foldManager ?? new FoldManager(textView.TextBuffer); statusUtil = statusUtil ?? new StatusUtil(); searchService = searchService ?? CreateSearchService(localSettings.GlobalSettings); undoRedoOperations = undoRedoOperations ?? new UndoRedoOperations(statusUtil, FSharpOption<ITextUndoHistory>.None); vimData = vimData ?? new VimData(); vimHost = vimHost ?? new MockVimHost(); navigator = navigator ?? CreateTextStructureNavigator(textView.TextBuffer); clipboardDevice = clipboardDevice ?? new MockClipboardDevice(); var operationsData = new OperationsData( editorOperations, editorOptions, foldManager, jumpList, keyMap, localSettings, outlining != null ? FSharpOption.Create(outlining) : FSharpOption<IOutliningManager>.None, CreateRegisterMap(clipboardDevice), searchService, EditorUtil.FactoryService.SmartIndentationService, statusUtil, textView, undoRedoOperations, vimData, vimHost, navigator); return new CommonOperations(operationsData); }
public SuperbarPresenter() { timer = new Timer(); Taskbar.AppID = "HudsonTray"; jumpList = Taskbar.JumpList; firstPoll = true; OnStatusChange += SuperbarPresenterOnStatusChange; statusWindow = new StatusWindow { WindowState = WindowState.Minimized }; statusWindow.Show(); statusWindow.HideOnClose = false; }
private void Create(int limit = 100) { _tlcService = new Mock<ITrackingLineColumnService>(MockBehavior.Strict); _jumpListRaw = new JumpList(_tlcService.Object, limit); _jumpList = _jumpListRaw; }