コード例 #1
0
        public override HRESULT GetURI(out string uri)
        {
            string  uriOut  = null;
            HRESULT hresult = HRESULT._S_OK;

            Microsoft.Zune.Service.EContentType eContentType;
            if (PlaylistManager.GetFieldValue(this._mediaId, this._listType, 177, -1) == 43)
            {
                eContentType = Microsoft.Zune.Service.EContentType.Video;
            }
            else
            {
                eContentType = Microsoft.Zune.Service.EContentType.MusicTrack;
                uriOut       = PlaylistManager.GetFieldValue(this._mediaId, this._listType, 317, (string)null);
                if (!string.IsNullOrEmpty(uriOut))
                {
                    try
                    {
                        if (new Uri(uriOut).Scheme == Uri.UriSchemeFile)
                        {
                            if (!ZuneLibrary.DoesFileExist(uriOut))
                            {
                                uriOut = null;
                            }
                        }
                    }
                    catch (UriFormatException ex)
                    {
                    }
                }
            }
            if (string.IsNullOrEmpty(uriOut) && this.ZuneMediaId != Guid.Empty)
            {
                hresult = ZuneApplication.Service.GetContentUri(this.ZuneMediaId, eContentType, Microsoft.Zune.Service.EContentUriFlags.None, out uriOut, out this._zuneMediaInstanceId);
            }
            uri = uriOut;
            return(hresult);
        }