diff --git a/ANX.Framework/FrameworkDispatcher.cs b/ANX.Framework/FrameworkDispatcher.cs index 86d2439c..b4cefbac 100644 --- a/ANX.Framework/FrameworkDispatcher.cs +++ b/ANX.Framework/FrameworkDispatcher.cs @@ -49,7 +49,11 @@ namespace ANX.Framework { - public class FrameworkDispatcher + public static class FrameworkDispatcher { + public static void Update() + { + throw new NotImplementedException(); + } } } diff --git a/ANX.Framework/GamerServices/GamerCollection.cs b/ANX.Framework/GamerServices/GamerCollection.cs index 02532a8b..029d4ef9 100644 --- a/ANX.Framework/GamerServices/GamerCollection.cs +++ b/ANX.Framework/GamerServices/GamerCollection.cs @@ -55,17 +55,68 @@ using System.Collections.Generic; namespace ANX.Framework.GamerServices { - public class GamerCollection : ReadOnlyCollection, IEnumerable, IEnumerable where T : Gamer - { + public class GamerCollection : ReadOnlyCollection, + IEnumerable, IEnumerable where T : Gamer + { + #region GamerCollectionEnumerator + public struct GamerCollectionEnumerator + : IEnumerator, IDisposable, IEnumerator + { + private List.Enumerator enumerator; - public GamerCollection() - : base(new List()) - { - } + public T Current + { + get + { + return enumerator.Current; + } + } - public new IEnumerator GetEnumerator() - { - throw new NotImplementedException(); - } - } + object IEnumerator.Current + { + get + { + return enumerator.Current; + } + } + + internal GamerCollectionEnumerator(List.Enumerator setEnumerator) + { + enumerator = setEnumerator; + } + + public void Dispose() + { + enumerator.Dispose(); + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + void IEnumerator.Reset() + { + ((IEnumerator)enumerator).Reset(); + } + } + #endregion + + public GamerCollection() + : base(new List()) + { + } + + #region GetEnumerator + public new GamerCollection.GamerCollectionEnumerator GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/ANX.Framework/Media/AlbumCollection.cs b/ANX.Framework/Media/AlbumCollection.cs index 30df2e60..fdb8d183 100644 --- a/ANX.Framework/Media/AlbumCollection.cs +++ b/ANX.Framework/Media/AlbumCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class AlbumCollection + public sealed class AlbumCollection + : IEnumerable, IEnumerable, IDisposable { + private List albums; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return albums.Count; + } + } + + public Album this[int index] + { + get + { + return albums[index]; + } + } + + public AlbumCollection() + { + albums = new List(); + IsDisposed = false; + } + + ~AlbumCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return albums.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return albums.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + albums.Clear(); + } + #endregion } } diff --git a/ANX.Framework/Media/ArtistCollection.cs b/ANX.Framework/Media/ArtistCollection.cs index 16992efb..3cf2dfb0 100644 --- a/ANX.Framework/Media/ArtistCollection.cs +++ b/ANX.Framework/Media/ArtistCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class ArtistCollection + public sealed class ArtistCollection + : IEnumerable, IEnumerable, IDisposable { + private List artists; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return artists.Count; + } + } + + public Artist this[int index] + { + get + { + return artists[index]; + } + } + + public ArtistCollection() + { + artists = new List(); + IsDisposed = false; + } + + ~ArtistCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return artists.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return artists.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + artists.Clear(); + } + #endregion } } diff --git a/ANX.Framework/Media/GenreCollection.cs b/ANX.Framework/Media/GenreCollection.cs index 513b8496..0181f7a1 100644 --- a/ANX.Framework/Media/GenreCollection.cs +++ b/ANX.Framework/Media/GenreCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class GenreCollection + public sealed class GenreCollection + : IEnumerable, IEnumerable, IDisposable { + private List genres; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return genres.Count; + } + } + + public Genre this[int index] + { + get + { + return genres[index]; + } + } + + public GenreCollection() + { + genres = new List(); + IsDisposed = false; + } + + ~GenreCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return genres.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return genres.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + genres.Clear(); + } + #endregion } } diff --git a/ANX.Framework/Media/PictureAlbumCollection.cs b/ANX.Framework/Media/PictureAlbumCollection.cs index de3218c9..aae03c6b 100644 --- a/ANX.Framework/Media/PictureAlbumCollection.cs +++ b/ANX.Framework/Media/PictureAlbumCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class PictureAlbumCollection + public sealed class PictureAlbumCollection + : IEnumerable, IEnumerable, IDisposable { + private List pictureAlbums; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return pictureAlbums.Count; + } + } + + public PictureAlbum this[int index] + { + get + { + return pictureAlbums[index]; + } + } + + public PictureAlbumCollection() + { + pictureAlbums = new List(); + IsDisposed = false; + } + + ~PictureAlbumCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return pictureAlbums.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return pictureAlbums.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + pictureAlbums.Clear(); + } + #endregion } } diff --git a/ANX.Framework/Media/PictureCollection.cs b/ANX.Framework/Media/PictureCollection.cs index 15ff2ce7..318fddf2 100644 --- a/ANX.Framework/Media/PictureCollection.cs +++ b/ANX.Framework/Media/PictureCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class PictureCollection + public sealed class PictureCollection + : IEnumerable, IEnumerable, IDisposable { + private List pictures; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return pictures.Count; + } + } + + public Picture this[int index] + { + get + { + return pictures[index]; + } + } + + public PictureCollection() + { + pictures = new List(); + IsDisposed = false; + } + + ~PictureCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return pictures.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return pictures.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + pictures.Clear(); + } + #endregion } } diff --git a/ANX.Framework/Media/PlaylistCollection.cs b/ANX.Framework/Media/PlaylistCollection.cs index dd0f7f79..79c7a33a 100644 --- a/ANX.Framework/Media/PlaylistCollection.cs +++ b/ANX.Framework/Media/PlaylistCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class PlaylistCollection + public sealed class PlaylistCollection + : IEnumerable, IEnumerable, IDisposable { + private List playlists; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return playlists.Count; + } + } + + public Playlist this[int index] + { + get + { + return playlists[index]; + } + } + + public PlaylistCollection() + { + playlists = new List(); + IsDisposed = false; + } + + ~PlaylistCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return playlists.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return playlists.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + playlists.Clear(); + } + #endregion } } diff --git a/ANX.Framework/Media/SongCollection.cs b/ANX.Framework/Media/SongCollection.cs index 4437329c..c0ee6a86 100644 --- a/ANX.Framework/Media/SongCollection.cs +++ b/ANX.Framework/Media/SongCollection.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; #region License @@ -49,7 +51,62 @@ namespace ANX.Framework.Media { - public class SongCollection + public sealed class SongCollection + : IEnumerable, IEnumerable, IDisposable { + private List songs; + + public bool IsDisposed + { + get; + private set; + } + + public int Count + { + get + { + return songs.Count; + } + } + + public Song this[int index] + { + get + { + return songs[index]; + } + } + + public SongCollection() + { + songs = new List(); + IsDisposed = false; + } + + ~SongCollection() + { + Dispose(); + } + + #region GetEnumerator + public IEnumerator GetEnumerator() + { + return songs.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return songs.GetEnumerator(); + } + #endregion + + #region Dispose + public void Dispose() + { + IsDisposed = true; + songs.Clear(); + } + #endregion } }