Exemple #1
0
        // powerful pattern
        private void PlaylistsMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            PlaylistsContextMenu.Close(ToolStripDropDownCloseReason.ItemClicked);

            var playlist = e.ClickedItem as PlaylistList;

            if (playlist == null)
            {
                return;
            }
            _channelView.PlaylistTypes = playlist.PlaylistType;

            // temporary, i don't like this...not intuitive to have to select Custom as the playlist type
            if (playlist.PlaylistType == StationType.Custom)
            {
                var ff     = new FavoritesForm <TChannel, TTrack>(_channelView);
                var result = ff.ShowDialog();
            }
            else
            {
                if (PlaylistPanel != null)
                {
                    PlaylistPanel.Channels = _channelView.GetView(true);
                }

                if (InvokeRequired)
                {
                    Invoke((Action)(() =>
                    {
                        BindChannelPlaylistPanel();
                        UpdateVisualCues();

                        if (ViewPlaylistsSplitButton == null)
                        {
                            return;
                        }
                        ViewPlaylistsSplitButton.Text = playlist.Name;
                        ViewPlaylistsSplitButton.Image = playlist.Image;
                        ViewPlaylistsSplitButton.Tag = playlist.SiteUri;     // HACK
                        ViewPlaylistsSplitButton.ToolTipText = playlist.SiteUri.AbsoluteUri;
                    }));
                }
                else
                {
                    BindChannelPlaylistPanel();
                    UpdateVisualCues();

                    if (ViewPlaylistsSplitButton != null)
                    {
                        ViewPlaylistsSplitButton.Text        = playlist.Name;
                        ViewPlaylistsSplitButton.Image       = playlist.Image;
                        ViewPlaylistsSplitButton.Tag         = playlist.SiteUri; // HACK
                        ViewPlaylistsSplitButton.ToolTipText = playlist.SiteUri.AbsoluteUri;
                    }
                }
            }
        }
Exemple #2
0
        private void sbtnFavorites_Click(object sender, RibbonControlEventArgs e)
        {
            var recent = (RecentFile)null;

            //Step 1: Login to DokuFlex to get the ticket;
            var ticket = Session.GetTikect();

            using (var form = new FavoritesForm(ticket, ".doc"))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    recent = form.SelectedValue;
                }
            }

            if (recent == null)
            {
                return;
            }

            Globals.ThisAddIn.OpenRecentDocument(ticket, recent);
        }