Exemplo n.º 1
0
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == Windows7Taskbar.TaskbarButtonCreatedMessage)
            {
                _jumpListManager = new JumpListManager(APP_ID);
                _jumpListManager.UserRemovedItems += delegate { };
                _jumpListManager.AddUserTask(new ShellLink
                {
                    Path  = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"Windows NT\Accessories\wordpad.exe"),
                    Title = "Launch Wordpad"
                });
                _jumpListManager.AddCustomDestination(new ShellItem
                {
                    Path     = @"D:\Users\Sasha\Documents\Courses\Windows 7\Code\SampleDocument.rtf",
                    Category = "Interesting"
                });
                _jumpListManager.Refresh();
            }

            if (_clipToggled)
            {
                SetClip();
            }

            if (_customWindowManager != null)
            {
                _customWindowManager.DispatchMessage(ref m);
                _customWindowManager.InvalidatePreviews();
            }

            base.WndProc(ref m);
        }
Exemplo n.º 2
0
 private void RefreshJumpList()
 {
     if (Utils.IsWin7OrLater)
     {
         try
         {
             _jumpListManager.ClearCustomDestinations();
             Iterator iterator = HistoryCollection.defaultCollection().iterator();
             while (iterator.hasNext())
             {
                 Host host = (Host)iterator.next();
                 _jumpListManager.AddCustomDestination(new ShellLink
                 {
                     Path         = FolderBookmarkCollection.favoritesCollection().getFile(host).getAbsolute(),
                     Title        = BookmarkNameProvider.toString(host, true),
                     Category     = LocaleFactory.localizedString("History"),
                     IconLocation =
                         System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cyberduck-document.ico"),
                     IconIndex = 0
                 });
             }
             _jumpListManager.Refresh();
         }
         catch (Exception exception)
         {
             Logger.warn("Exception while refreshing jump list", exception);
         }
     }
 }
Exemplo n.º 3
0
        protected override void WndProc(ref Message m)
        {
            //

            if (m.Msg == Windows7Taskbar.TaskbarButtonCreatedMessage)
            {
                _jumpListManager = new JumpListManager(APP_ID);
                _jumpListManager.UserRemovedItems += delegate { };
                _jumpListManager.AddUserTask(new ShellLink
                {
                    Path  = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"Windows NT\Accessories\wordpad.exe"),
                    Title = "Launch Wordpad"
                });


                _jumpListManager.AddCustomDestination(new ShellItem
                {
                    Path     = "C:\\Document1.rtf",
                    Category = "Interesting"
                });
                _jumpListManager.Refresh();
            }



            base.WndProc(ref m);
        }
Exemplo n.º 4
0
        private void btnBuildJumpList_Click(object sender, EventArgs e)
        {
            string shell32DllPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "shell32.dll");

            _jumpListManager.AddCustomDestination(new ShellLink
            {
                Path         = Path.Combine(_thisAppDataPath, "sonnet.txt"),
                Title        = "Shall I compare thee...",
                Category     = "My Category",
                IconLocation = shell32DllPath,
                IconIndex    = 1
            });
            _jumpListManager.AddCustomDestination(new ShellLink
            {
                Path         = Path.Combine(_thisAppDataPath, "mary.txt"),
                Title        = "Mary had a little...",
                Category     = "My Category",
                IconLocation = shell32DllPath,
                IconIndex    = 1
            });
            _jumpListManager.AddCustomDestination(new ShellLink
            {
                Path         = Path.Combine(_thisAppDataPath, "hello.html"),
                Title        = "Hello World",
                Category     = "My Other Category",
                IconLocation = shell32DllPath,
                IconIndex    = 5
            });
            _jumpListManager.AddCustomDestination(new ShellItem
            {
                Path     = Path.Combine(_thisAppDataPath, "raven.txt"),
                Category = "My Other Category"
            });
            _jumpListManager.AddUserTask(new ShellLink
            {
                Path         = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe"),
                Title        = "Launch Notepad",
                IconLocation = shell32DllPath,
                IconIndex    = 14
            });
            _jumpListManager.AddUserTask(new Separator());
            _jumpListManager.AddUserTask(new ShellLink
            {
                Path         = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "calc.exe"),
                Title        = "Launch Calculator",
                IconLocation = shell32DllPath,
                IconIndex    = 15
            });
            if (_jumpListManager.Refresh())
            {
                statusLabel.Text = "Maximum slots in list: " +
                                   _jumpListManager.MaximumSlotsInList;
            }
        }
Exemplo n.º 5
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            JumpListManager.AddCategorySelfLink("Commands", "First command", "Command1");
            JumpListManager.AddCategorySelfLink("Commands", "Second command", "Command2");
            JumpListManager.AddCategorySelfLink("Commands", "Third command", "Command3");

            JumpListManager.AddCategoryLink("Links", "Around and About .NET World", "http://blogs.ugidotnet.org/marcom", "shell32.dll", 220);

            JumpListManager.AddTaskLink("Start Notepad", "notepad.exe", "notepad.exe");
            JumpListManager.AddTaskLink("Start Calculator", "calc.exe", "calc.exe");
            JumpListManager.AddTaskLink("Start Paint", "mspaint.exe", "mspaint.exe");

            JumpListManager.Refresh();
        }
Exemplo n.º 6
0
        private void InitializeTaskbarControls()
        {
            stopThumbnailButton        = new ThumbnailToolBarButton(Properties.Resources.stop, "Detener");
            stopThumbnailButton.Click += (sender, args) =>
            {
                StopRadioStream();
            };

            stopThumbnailButton.Enabled = false;

            previousThumbnailButton        = new ThumbnailToolBarButton(Properties.Resources.previous, "Sintonizar radio anterior");
            previousThumbnailButton.Click += async(sender, args) =>
            {
                if (_previousStreamUrl != null && _previousStreamDescription != null)
                {
                    await PlayRadioStream(_previousStreamUrl, _previousStreamDescription);
                }
            };

            muteThumbnailButton        = new ThumbnailToolBarButton(Properties.Resources.speaker, "Silenciar");
            muteThumbnailButton.Click += (sender, args) =>
            {
                MuteRadioStream();
            };

            TaskbarManager.Instance.ThumbnailToolBars.AddButtons(Handle, stopThumbnailButton, previousThumbnailButton, muteThumbnailButton);

            JumpListCommandReceived += (sender, e) =>
            {
                CheckLineArguments(e.CommandName);
            };

            Shown += (sender, e) =>
            {
                string categoryName  = "Radios";
                char   commandPrefix = '-';

                foreach (KeyValuePair <string, Radio> radio in RadioGroup.Stations)
                {
                    JumpListManager.AddCategorySelfLink(
                        categoryName,
                        radio.Value.Description,
                        commandPrefix + radio.Key,
                        radio.Value.Icon,
                        0
                        );
                }

                JumpListManager.Refresh();

                if (_args.Length > 1)
                {
                    foreach (KeyValuePair <string, Radio> radio in RadioGroup.Stations)
                    {
                        if (_args[1] == radio.Value.Command)
                        {
                            CheckLineArguments(commandPrefix + radio.Key);
                        }
                    }
                }
            };
        }
Exemplo n.º 7
0
 private void MainForm_Shown(object sender, EventArgs e)
 {
     JumpListManager.AddCategoryLink("链接", "星际争霸2战术资源站", "http://sc2.haoest.com", "shell32.dll", 220);
     JumpListManager.Refresh();
 }