diff --git a/Sources/Model/InfoTitle.cs b/Sources/Model/InfoTitle.cs index bb9eb4d..eb4e688 100644 --- a/Sources/Model/InfoTitle.cs +++ b/Sources/Model/InfoTitle.cs @@ -17,9 +17,17 @@ public class InfoTitle : Title } } - private string description; + private string description = ""; - public IEnumerable Feat { get; set; } + public IEnumerable Feat + { + get + { + return feat; + } + } + + private List feat = new List(); public Genre Genre { get; set; } @@ -28,19 +36,15 @@ public class InfoTitle : Title Artiste = artist; Description = description; Genre = genre; - Feat = new List(); } public void AddFeat(Artiste artist) { - Feat.Prepend(artist); + feat.Add(artist); } public void RemoveFeat(Artiste artiste) { - foreach (var item in Feat) - { - Feat = Feat.Where(item => item != artiste).ToList(); - } + feat.Remove(artiste); } } diff --git a/Sources/Model/Manager.cs b/Sources/Model/Manager.cs index 9de8d13..4f8e51b 100644 --- a/Sources/Model/Manager.cs +++ b/Sources/Model/Manager.cs @@ -4,48 +4,68 @@ public class Manager { public IDataManager DataManager { get; set; } - public IEnumerable Albums; + public IEnumerable Albums + { + get + { + return albums; + } + } + + private List albums = new List(); - public IEnumerable Titles; + public IEnumerable<Title> Titles + { + get + { + return titles; + } + } + + private List<Title> titles = new List<Title>(); + + public IEnumerable<Playlist> Playlists + { + get + { + return playlists; + } + } - public IEnumerable<Playlist> Playlists; + private List<Playlist> playlists = new List<Playlist>(); public Manager() { DataManager = new Stub(); - // Albums = DataManager.GetAlbum(); - Albums = new List<Album>(); - Titles = new List<Title>(); - Playlists = new List<Playlist>(); } public void AddAlbum(Album album) { - Albums.Prepend(album); + albums.Add(album); } public void AddTitle(Title title) { - Titles.Prepend(title); + titles.Add(title); } public void AddPlaylist(Playlist playlist) { - Playlists.Prepend(playlist); + playlists.Add(playlist); } public void RemoveAlbum(Album album) { - Albums.ToList().Remove(album); + albums.Remove(album); } public void RemoveTitle(Title title) { - Titles.ToList().Remove(title); + titles.Remove(title); } public void RemovePlaylist(Playlist playlist) { - Playlists.ToList().Remove(playlist); + playlists.Remove(playlist); } }