Ejemplo n.º 1
0
        private Album CreateAlbum(string title)
        {
            Album a = new Album();
            a.Title = title;
            a.Price = 12 + rnd.Next(-4, +6);
            ArrayList tracks = new ArrayList();
            int maxTrack = 4 + rnd.Next(-2, +2);
            for (int i = 0; i < maxTrack; i++)
            {
                Track t = new Track();
                t.Name = "Track-" + title + "-" + i.ToString();
                t.Duration = 100 + rnd.Next(-50, +100); ;
                tracks.Add(t);
            }
            Track[] arr = new Track[tracks.Count];
            tracks.CopyTo(arr);
            a.Tracks = arr;

            return a;
        }
Ejemplo n.º 2
0
 public Album[] GetAlbumList()
 {
     Album[] arr = new Album[albums.Count];
     albums.CopyTo(arr);
     return arr;
 }