Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        private void Main_Activated(object sender, EventArgs e)
        {
            Button_EditClient.Enabled   = false;
            Button_DeleteClient.Enabled = false;
            Button_RunClient.Enabled    = false;
            ClientList.Items.Clear();
            DataTable dt = ClientDAL.GetAllClient();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ClientList.Items.Add(dt.Rows[i]["region"] + " - " + dt.Rows[i]["name"] + " - " + dt.Rows[i]["locale"]);
                JumpListManager.AddCategorySelfLink("快速启动", dt.Rows[i]["locale"].ToString(), dt.Rows[i]["locale"].ToString());
            }

            if (ClientList.Items.Count == 0)
            {
                ClientList.Items.Add("尚未添加客户端,请添加!");
                ClientList.Enabled = false;
            }
            else
            {
                ClientList.Enabled = true;
            }
        }
Ejemplo n.º 3
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);
                        }
                    }
                }
            };
        }