public void ShowPlaylistItem(PlaylistItem plItem, bool callByProperty)
        {
            try
            {
                this.CanSaveData = false;

                if (plItem == null && callByProperty)
                {
                    List <PlaylistItem> plItems = playlistScreen.GetPlaylistItems();
                    if (plItems != null && plItems.Count > 0)
                    {
                        plItem = plItems[0];
                    }
                }

                pgProperties.Tag            = null;
                pgProperties.SelectedObject = null;
                pgProperties.Visible        = false;
                lblNoInfo.Visible           = true;
                lblItem.Text = string.Empty;

                if (plItem != null)
                {
                    plItem.Rebuild();

                    lblItem.Text = plItem.MediaFileInfo.Path;

                    if (plItem.SupportsTrackInfo)
                    {
                        pgProperties.Tag = plItem;

                        MediaFileInfoSlim slim = plItem.MediaFileInfo.Slim();
                        FileAttributesBrowser.ProcessSingleObjectAttributes(slim);
                        pgProperties.SelectedObject = slim;

                        pgProperties.Visible = true;
                        lblNoInfo.Visible    = false;
                    }
                }

                if (callByProperty)
                {
                    playlistScreen.SetFirstSelectedPlaylistItem(plItem);
                }
            }
            finally
            {
                this.CanSaveData = true;
            }
        }
Esempio n. 2
0
        void lvPlaylist_ItemMouseHover(object sender, ListViewItemMouseHoverEventArgs e)
        {
            if (_compactMode)
            {
                return;
            }

            ListViewItem item = e.Item;
            bool         set  = false;
            Point        p    = lvPlaylist.PointToClient(MousePosition);

            try
            {
                if (item != null && MouseButtons == MouseButtons.None)
                {
                    ListViewItem.ListViewSubItem lvsi = item.GetSubItemAt(p.X, p.Y);
                    if (lvsi != null)
                    {
                        ExtendedSubItemDetail esid = lvsi.Tag as ExtendedSubItemDetail;
                        if (esid != null && !string.IsNullOrEmpty(esid.Text))
                        {
                            _ttm.ShowSimpleToolTip(esid.Text, ImageProcessing.Subtitle);
                            set = true;
                        }
                        else
                        {
                            PlaylistItem pli = item.Tag as PlaylistItem;
                            if (pli != null)
                            {
                                pli.Rebuild();

                                Image customImage = pli.MediaFileInfo.CustomImage;

                                _ttm.ShowToolTip(StringUtils.Limit(pli.DisplayName, 60), pli.MediaInfo, pli.GetImageEx(true), customImage);
                                set = true;
                            }
                        }
                    }
                }
            }
            finally
            {
                if (!set)
                {
                    Debug.WriteLine("PL: lvPlaylist_ItemMouseHover no tip to set ...");
                    _ttm.RemoveAll();
                }
            }
        }