MonoTouch.MediaPlayer.MPMediaQuerySection Class
A subset of the values returned by a MonoTouch.MediaPlayer.MPMediaQuery, as specified by the MPMediaQuery.ItemSections or MPMediaQuery.CollectionSections properties.

See Also: MPMediaQuerySection Members

Syntax

[MonoTouch.Foundation.Register("MPMediaQuerySection", true)]
[MonoTouch.ObjCRuntime.Availability(Introduced=MonoTouch.ObjCRuntime.Platform.iOS_4_2)]
public class MPMediaQuerySection : MonoTouch.Foundation.NSObject, MonoTouch.Foundation.INSCopying, MonoTouch.Foundation.INSSecureCoding, IDisposable

See Also

MPMediaQuery

Remarks

MonoTouch.MediaPlayer.MPMediaQuerySections represent a subset of results of a MonoTouch.MediaPlayer.MPMediaQuery. You can control the grouping by specifying the MonoTouch.MPMediaQuery.GroupingType as shown in the following example, which outputs the songs from albums whose title's start with the letter 'S':

C# Example

          var mq = new MPMediaQuery();
          mq.GroupingType = MPMediaGrouping.Album;
          
          var value = NSNumber.FromInt32((int)MPMediaType.Music);
          var predicate = MPMediaPropertyPredicate.PredicateWithValue(value, MPMediaItem.MediaTypeProperty);
          mq.AddFilterPredicate(predicate);
          var items = mq.Items;
          var secs = mq.ItemSections;
          
          if(secs != null)
          {
             var songsFromSAlbums = 
                from sSection in 
                from sec in secs where sec.Title == "S" select sec
                from song in items.Skip(sSection.Range.Location).Take(sSection.Range.Length) select song;
             foreach(var song in songsFromSAlbums)
             {
                Console.WriteLine(song.Title + ": " + song.AlbumTitle);
             }
          }
          

Related content

Requirements

Namespace: MonoTouch.MediaPlayer
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0