示例#1
0
        /// <summary>
        /// Returns a collection containing the tracks with the specified text.
        /// <para>
        /// If searchFields is ITPlaylistSearchFieldVisible , this is identical to the list of
        /// tracks displayed if the user enters the search text in the Search edit field in
        /// iTunes when this playlist is being displayed.
        /// </para>
        /// </summary>
        /// <param name="searchText">
        /// The text to search for. This string cannot be longer than 255 characters.
        /// </param>
        /// <param name="searchFields">
        /// Specifies which fields of each track should be searched for searchText.
        /// </param>
        /// <returns>
        /// Collection of Track objects. This will be empty if no tracks meet the search
        /// criteria.
        /// </returns>

        public TrackCollection Search(string searchText, ITPlaylistSearchField searchFields)
        {
            return(Invoke((Func <TrackCollection>) delegate
            {
                TrackCollection collection = new TrackCollection();
                IITTrackCollection results = playlist.Search(searchText, searchFields);
                if (results != null)
                {
                    foreach (IITTrack track in results)
                    {
                        if (track != null)
                        {
                            collection.Add(new Track(track));
                        }
                    }
                }
                return collection;
            }));
        }
示例#2
0
 public IITTrackCollection Search(string searchText, ITPlaylistSearchField searchFields)
 {
     throw new NotImplementedException();
 }
示例#3
0
 /// <summary>
 /// Returns a collection containing the tracks with the specified text. 
 /// <para>
 /// If searchFields is ITPlaylistSearchFieldVisible , this is identical to the list of
 /// tracks displayed if the user enters the search text in the Search edit field in
 /// iTunes when this playlist is being displayed.
 /// </para>
 /// </summary>
 /// <param name="searchText">
 /// The text to search for. This string cannot be longer than 255 characters.
 /// </param>
 /// <param name="searchFields">
 /// Specifies which fields of each track should be searched for searchText.
 /// </param>
 /// <returns>
 /// Collection of Track objects. This will be empty if no tracks meet the search
 /// criteria.
 /// </returns>
 public TrackCollection Search(string searchText, ITPlaylistSearchField searchFields)
 {
     return Invoke((Func<TrackCollection>)delegate
     {
         TrackCollection collection = new TrackCollection();
         IITTrackCollection results = playlist.Search(searchText, searchFields);
         if (results != null)
         {
             foreach (IITTrack track in results)
             {
                 if (track != null)
                 {
                     collection.Add(new Track(track));
                 }
             }
         }
         return collection;
     });
 }
 public static IEnumerable SearchSafe(this IITPlaylist playlist, string searchText, ITPlaylistSearchField searchFields)
 {
     if (string.IsNullOrEmpty(searchText)) return Enumerable.Empty<IITTrack>();
     return (IEnumerable)playlist.Search(searchText, searchFields) ?? Enumerable.Empty<IITTrack>();
 }
示例#5
0
 public IITTrackCollection Search(string searchText, ITPlaylistSearchField searchFields)
 {
     throw new NotImplementedException();
 }