コード例 #1
0
        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;
            }
        }
コード例 #2
0
        public void SaveData()
        {
            PlaylistItem plItem = pgProperties.Tag as PlaylistItem;

            if (plItem != null && plItem.IsTrackInfoEditable)
            {
                try
                {
                    MediaFileInfoSlim mfis = pgProperties.SelectedObject as MediaFileInfoSlim;
                    if (mfis != null)
                    {
                        mfis.Save();
                    }
                }
                catch (Exception ex)
                {
                    ErrorDispatcher.DispatchError(ex, false);
                }
            }
        }