2012-08-09 09:45:04 +00:00
|
|
|
using System;
|
2011-11-17 21:02:52 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2011-11-17 20:35:25 +00:00
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-11-17 20:35:25 +00:00
|
|
|
|
|
|
|
namespace ANX.Framework.Media
|
|
|
|
{
|
2012-08-26 10:31:54 +00:00
|
|
|
public sealed class GenreCollection : IEnumerable<Genre>, IEnumerable, IDisposable
|
2011-11-17 20:35:25 +00:00
|
|
|
{
|
2011-11-17 21:02:52 +00:00
|
|
|
private List<Genre> genres;
|
|
|
|
|
|
|
|
public bool IsDisposed
|
|
|
|
{
|
|
|
|
get;
|
|
|
|
private set;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int Count
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return genres.Count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Genre this[int index]
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return genres[index];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-26 10:31:54 +00:00
|
|
|
internal GenreCollection()
|
2011-11-17 21:02:52 +00:00
|
|
|
{
|
|
|
|
genres = new List<Genre>();
|
|
|
|
IsDisposed = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
~GenreCollection()
|
|
|
|
{
|
|
|
|
Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
#region GetEnumerator
|
|
|
|
public IEnumerator<Genre> GetEnumerator()
|
|
|
|
{
|
|
|
|
return genres.GetEnumerator();
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
|
|
{
|
|
|
|
return genres.GetEnumerator();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Dispose
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
IsDisposed = true;
|
|
|
|
genres.Clear();
|
|
|
|
}
|
|
|
|
#endregion
|
2011-11-17 20:35:25 +00:00
|
|
|
}
|
|
|
|
}
|