IndexOf() public method

public IndexOf ( IMediaFile item ) : int
item IMediaFile
return int
コード例 #1
0
        private async Task ExtractMediaInformation(IMediaFile mediaFile)
        {
            var index = MediaQueue.IndexOf(mediaFile);
            await MediaExtractor.ExtractMediaInfo(mediaFile);

            if (index >= 0)
            {
                MediaQueue[index] = mediaFile;
            }

            OnMediaFileChanged(CurrentPlaybackManager, new MediaFileChangedEventArgs(mediaFile));
        }
コード例 #2
0
        private async Task GetMediaInformation(IEnumerable <IMediaFile> mediaFiles)
        {
            foreach (var mediaFile in mediaFiles)
            {
                try
                {
                    var index = MediaQueue.IndexOf(mediaFile);
                    var info  = await MediaExtractor.ExtractMediaInfo(mediaFile);

                    if (index >= 0)
                    {
                        MediaQueue[index] = info;
                    }
                    OnMediaFileChanged(CurrentPlaybackManager, new MediaFileChangedEventArgs(info));
                }
                catch (Exception e)
                {
                    OnMediaFileFailed(this, new MediaFileFailedEventArgs(e, mediaFile));
                }
            }
        }