Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        private void BuildJumpList()
        {
            List <JumpItem> customCat = new List <JumpItem>();

            if (lstv_atalhos.Items.Count > 0)
            {
                foreach (ListItems listItem in lstv_atalhos.Items)
                {
                    JumpTask jumpItem = new JumpTask()
                    {
                        ApplicationPath  = listItem.path,
                        IconResourcePath = listItem.imagePath,
                        Title            = listItem.Title,
                        Description      = listItem.Title,
                        CustomCategory   = "Shortcuts"
                    };
                    customCat.Add(jumpItem);
                }
            }

            JumpList jumpList = new JumpList();// customCat, true, true);

            jumpList.JumpItems.AddRange(customCat);
            JumpList.SetJumpList(App.Current, jumpList);
        }
Exemplo n.º 3
0
        public void UpdateJumpList()
        {
            OnPropertyChanged(nameof(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 = PlaynitePaths.ExecutablePath
                };

                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.ShowFrequentCategory = false;
                jumpList.ShowRecentCategory   = false;
            }

            JumpList.SetJumpList(Application.Current, jumpList);
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Updates the portion of the JumpList which shows new/unread email.
        /// </summary>
        internal void UpdateJumpList()
        {
            if (!_config.RecentDocsTracked)               // if the user doesn't have recent docs turned on, this will method throw errors.
            {
                return;
            }

            _jumpList.RemoveCustomCategories();

            String iconPath    = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\Icons\\Mail.ico");
            String inboxFormat = "{0} ({1})";

            foreach (Notifier notifier in _instances.Values)
            {
                Account account  = notifier.Account;
                String  category = String.Format(inboxFormat, account.FullAddress, notifier.Unread);

                foreach (Email email in notifier.Emails)
                {
                    JumpTask task = new JumpTask()
                    {
                        ApplicationPath   = account.Browser != null ? account.Browser.Path : email.Url,
                        Arguments         = email.Url,
                        IconResourceIndex = 0,
                        IconResourcePath  = iconPath,
                        Title             = email.Title,
                        CustomCategory    = category
                    };

                    _jumpList.JumpItems.Add(task);
                }
            }

            _jumpList.Apply();             // refreshes
        }
Exemplo n.º 6
0
        private void CreateJumpList()
        {
            JumpList appJumpList = new JumpList();

            //Configure a JumpTask
            JumpTask jumpTask1 = new JumpTask();

            jumpTask1.ApplicationPath  = @"C:\Program Files (x86)\Internet Explorer\iexplore.exe";
            jumpTask1.IconResourcePath = @"C:\Program Files (x86)\Internet Explorer\iexplore.exe";

            jumpTask1.Title       = "IE";
            jumpTask1.Description = "Open IE";

            JumpTask jumpTask2 = new JumpTask();

            jumpTask2.ApplicationPath  = @"C:\Windows\System32\notepad.exe";
            jumpTask2.IconResourcePath = @"C:\Windows\System32\notepad.exe";

            jumpTask2.Title       = "Calculator";
            jumpTask2.Description = "Open Calc";

            appJumpList.JumpItems.Add(jumpTask1);
            appJumpList.JumpItems.Add(jumpTask2);

            JumpList.SetJumpList(App.Current, appJumpList);
        }
Exemplo n.º 7
0
        private static JumpTask CreateJumpTaskItem(Data.LiftItem entry)
        {
            var result = new JumpTask
            {
                Title            = entry.Title,
                Arguments        = entry.Arguments,
                Description      = entry.Hint,
                CustomCategory   = entry.Category,
                IconResourcePath = entry.FilePath,
                ApplicationPath  = entry.FilePath
            };

            var ext = System.IO.Path.GetExtension(entry.FilePath);

            if (ext != ".exe")
            {
                var info = IconTool.GetAssociatedExeForExtension(ext);
                if (info != null)
                {
                    result.IconResourcePath  = info.FilePath;
                    result.IconResourceIndex = info.IconIndex;
                }
            }

            return(result);
        }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
0
        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();
        }
Exemplo n.º 10
0
        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();
        }
Exemplo n.º 11
0
        /// <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();
        }
Exemplo n.º 12
0
        private void UpdateJumpList()
        {
            var jumpList = JumpList.GetJumpList(Application.Current) ?? new JumpList();

            jumpList.ShowRecentCategory = true;

            // Remove JumpTasks for folders,which are not in the MRU list anymore
            //jumpList.JumpItems.RemoveAll(item => item is JumpTask && !_folders.Any(path => String.Equals(path, ((JumpTask)item).Title, StringComparison.OrdinalIgnoreCase)));

            // add JumpTasks for folders, which do not exist already
            foreach (var folder in _folders.Where(f => !jumpList.JumpItems.OfType <JumpTask>().Any(item => String.Equals(f, item.Title, StringComparison.OrdinalIgnoreCase))))
            {
                var jumpTask = new JumpTask {
                    ApplicationPath   = Assembly.GetExecutingAssembly().Location,
                    Arguments         = folder,
                    IconResourcePath  = @"C:\Windows\System32\shell32.dll",
                    IconResourceIndex = 3,
                    Title             = folder,
                    CustomCategory    = "Recent folders"
                };
                JumpList.AddToRecentCategory(jumpTask);
            }

            jumpList.Apply();
        }
Exemplo n.º 13
0
        //jump list
        private void AddJumpList()
        {
            JumpTask darkJumpTask = new JumpTask
            {
                Title          = Properties.Resources.lblDarkTheme,  //Dark theme
                Arguments      = Command.Dark,
                CustomCategory = Properties.Resources.lblSwitchTheme //Switch current theme
            };
            JumpTask lightJumpTask = new JumpTask
            {
                Title          = Properties.Resources.lblLightTheme, //Light theme
                Arguments      = Command.Light,
                CustomCategory = Properties.Resources.lblSwitchTheme //Switch current theme
            };
            JumpTask resetJumpTask = new JumpTask
            {
                Title          = Properties.Resources.lblReset,      //Light theme
                Arguments      = Command.NoForce,
                CustomCategory = Properties.Resources.lblSwitchTheme //Switch current theme
            };

            JumpList jumpList = new JumpList();

            jumpList.JumpItems.Add(darkJumpTask);
            jumpList.JumpItems.Add(lightJumpTask);
            jumpList.JumpItems.Add(resetJumpTask);
            jumpList.ShowFrequentCategory = false;
            jumpList.ShowRecentCategory   = false;

            JumpList.SetJumpList(Application.Current, jumpList);
        }
Exemplo n.º 14
0
        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();
        }
Exemplo n.º 15
0
        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);
        }
Exemplo n.º 16
0
        protected override void OnStartup(StartupEventArgs e)
        {
            //base.OnStartup(e);

            if (e.Args.Length > 0)
            {
                MessageBox.Show("Test");
                Shutdown();
            }

            JumpTask jumpTask = new JumpTask
            {
                Title            = "This is a test",
                Description      = "A test jump list.",
                IconResourcePath = System.Reflection.Assembly.GetEntryAssembly().CodeBase,
                ApplicationPath  = System.Reflection.Assembly.GetEntryAssembly().CodeBase,
                Arguments        = "/test"
            };

            JumpList jumpList = new JumpList();

            jumpList.JumpItems.Add(jumpTask);
            jumpList.ShowFrequentCategory = false;
            jumpList.ShowRecentCategory   = false;

            JumpList.SetJumpList(Current, jumpList);

            // Open another window: new Windows.About().Show();
        }
Exemplo n.º 17
0
        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();
        }
Exemplo n.º 18
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Retrieve the current jump list.
            var jumpList = new JumpList();

            JumpList.SetJumpList(Current, jumpList);

            // Add a new JumpPath for a file in the application folder.
            var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (path != null)
            {
                path = Path.Combine(path, "readme.txt");
                if (File.Exists(path))
                {
                    var jumpTask = new JumpTask
                    {
                        CustomCategory   = "Documentation",
                        Title            = "Read the readme.txt",
                        ApplicationPath  = @"c:\windows\notepad.exe",
                        IconResourcePath = @"c:\windows\notepad.exe",
                        Arguments        = path
                    };

                    jumpList.JumpItems.Add(jumpTask);
                }
            }

            // Update the jump list.
            jumpList.Apply();
        }
Exemplo n.º 19
0
        /// <summary>
        /// Creates a JumpTask
        /// </summary>
        /// <param name="game"></param>
        /// <returns></returns>
        private JumpTask CreateJumpTask(Game game)
        {
            JumpTask jumpTask1 = new JumpTask();

            jumpTask1.ApplicationPath  = Settings.Default.MAME_EXE;
            jumpTask1.WorkingDirectory = Path.GetDirectoryName(Settings.Default.MAME_EXE);
            jumpTask1.Arguments        = game.Name;

            string iconPath = game.IsParent
                                  ? Settings.Default.icons_directory + game.Name + ".ico"
                                  : Settings.Default.icons_directory + game.ParentSet + ".ico";

            if (!File.Exists(iconPath))
            {
                jumpTask1.IconResourcePath = Application.ExecutablePath;
            }
            else
            {
                jumpTask1.IconResourcePath = iconPath;
            }
            jumpTask1.Title          = game.Description;
            jumpTask1.Description    = game.Year + " " + game.Manufacturer;
            jumpTask1.CustomCategory = "Recently Played Games";


            return(jumpTask1);
        }
Exemplo n.º 20
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var jt = new JumpTask
            {
                ApplicationPath = "C:\\Windows\\notepad.exe",
                Arguments       = "readme.txt",
                Title           = "Recent Entry for Notepad",
                CustomCategory  = "Dummy"
            };

            JumpList.AddToRecentCategory(jt);



            var jt2 = new JumpTask
            {
                ApplicationPath = "C:\\Windows\\notepad.exe",
                Arguments       = "readme.txt",
                Title           = "Code Entry for Notepad",
                CustomCategory  = "Dummy"
            };

            var currentJumplist = JumpList.GetJumpList(App.Current);

            currentJumplist.JumpItems.Add(jt2);
            currentJumplist.Apply();
        }
Exemplo n.º 21
0
        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();
        }
Exemplo n.º 22
0
        /// <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
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// add an item to the W7+ jumplist
        /// </summary>
        /// <param name="fullpath">fully qualified path, can include '|' character for archives</param>
        public static void AddRecentItem(string fullpath)
        {
            string title;

            if (fullpath.Contains('|'))
            {
                title = fullpath.Split('|')[1];
            }
            else
            {
                title = Path.GetFileName(fullpath);
            }

            string exepath = Assembly.GetEntryAssembly().Location;

            var ji = new JumpTask
            {
                ApplicationPath = exepath,
                Arguments       = '"' + fullpath + '"',
                Title           = title,
                // for some reason, this doesn't work
                WorkingDirectory = Path.GetDirectoryName(exepath)
            };

            JumpList.AddToRecentCategory(ji);
        }
Exemplo n.º 24
0
        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();
            }
        }
Exemplo n.º 25
0
        public static Task MakeJumpList()
        {
            if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 1)
            {
                var jumpList = new JumpList();

                for (var i = 0; i < 10; i++)
                {
                    if (i > CustomPage.Profiles.Count - 1)
                    {
                        break;
                    }

                    //Configure a new JumpTask
                    var jumpTask = new JumpTask
                    {
                        // Set the JumpTask properties.
                        ApplicationPath  = FileLocations.MultiRPCStartLink,
                        Arguments        = $"-custom \"{CustomPage.Profiles.ElementAt(i).Key}\"",
                        IconResourcePath = FileLocations.MultiRPCStartLink,
                        Title            = CustomPage.Profiles.ElementAt(i).Key,
                        Description      = $"{App.Text.Load} '{CustomPage.Profiles.ElementAt(i).Key}'",
                        CustomCategory   = App.Text.CustomProfiles
                    };
                    jumpList.JumpItems.Add(jumpTask);
                }

                JumpList.SetJumpList(Application.Current, jumpList);
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 26
0
        public JumpTask asJumpTask()
        {
            var task = new JumpTask();

            task.Title           = Name;
            task.Description     = "Play station " + Name;
            task.ApplicationPath = Assembly.GetEntryAssembly().Location;
            task.Arguments       = "--station=" + ID;
            return(task);
        }
Exemplo n.º 27
0
        /// <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();
        }
Exemplo n.º 28
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var iconsDll = Path.GetDirectoryName(Assembly.GetEntryAssembly().CodeBase).Replace("\\", "/") + "/ScreenshotOCRIcons.dll";

            var screenshotTask = new JumpTask()
            {
                Title             = "Take instant screenshot",
                Description       = "Immediately launch screenshot mode",
                Arguments         = "/screenshot",
                IconResourcePath  = iconsDll,
                IconResourceIndex = 0,
                ApplicationPath   = Assembly.GetEntryAssembly().CodeBase
            };

            var s = Assembly.GetEntryAssembly();

            var settingsTask = new JumpTask()
            {
                Title             = "Settings",
                Description       = "Edit ScreenshotOCR settings",
                Arguments         = "/settings",
                IconResourcePath  = iconsDll,
                IconResourceIndex = 1,
                ApplicationPath   = Assembly.GetEntryAssembly().CodeBase
            };

            var jumpList = new JumpList();

            jumpList.JumpItems.Add(screenshotTask);
            jumpList.JumpItems.Add(settingsTask);
            jumpList.ShowFrequentCategory = false;
            jumpList.ShowRecentCategory   = false;

            JumpList.SetJumpList(Current, jumpList);

            if (e.Args.Length > 0)
            {
                if (e.Args[0] == "/screenshot")
                {
                    new ScreenshotTaker().Show();
                    return;
                }
                else if (e.Args[0] == "/settings")
                {
                    //todo
                    MessageBox.Show("settings coming soon!");
                    //return;
                }
            }

            new MainWindow().Show();
        }
Exemplo n.º 29
0
        private void JumpTask_AddToCategory(object sender, RoutedEventArgs e)
        {
            JumpTask jt = GenerateJumpTask();
            var      jl = JumpList.GetJumpList(Application.Current);

            jl.JumpItems.Add(jt);
            if (!DeferApply)
            {
                jl.Apply();
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// Adds a connection item to Jump List.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="jumpList"></param>
        /// <param name="connectionInfo"></param>
        public static void AddConnectionJumpTask <T>(JumpList jumpList, T connectionInfo) where T : ConnectionInfoBase
        {
            var jumpTask = new JumpTask()
            {
                CustomCategory = connectionInfo.ConnectionType.ToString(),
                Title          = connectionInfo.Name,
                Description    = connectionInfo.ToString(),
                Arguments      = $"/open={connectionInfo.ConnectionType.ToString().ToLower()}:{connectionInfo.Id}",
            };

            jumpList.JumpItems.Add(jumpTask);
        }