Sdílet prostřednictvím


SongCollection.Item Property

Gets the Song at the specified index in the SongCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public Song this [
         int index
] { get; }

Property Value

A new Song representing the song at the specified index in this SongCollection.

Remarks

Each call returns a new Song instance.

Song resources such as the album, artist, and genre are cached in each Song instance. Retrieving and maintaining references to multiple instances of the same song, and then accessing the album, artist, or genre on each of those instances, creates multiple copies of the album, artist, or genre. Because large numbers of album art textures can consume considerable memory, it is not advisable to hold a large number of Song objects on which Song.Album.GetAlbumArt has been called.

See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune