anx.framework/ANX.Framework/Graphics/DisplayModeCollection.cs

44 lines
1.2 KiB
C#
Raw Permalink Normal View History

#region Using Statements
2011-10-31 05:36:24 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
2012-10-10 19:26:53 +00:00
using ANX.Framework.NonXNA.Development;
2011-10-31 05:36:24 +00:00
#endregion // Using Statements
// 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-10-31 05:36:24 +00:00
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
2011-10-31 05:36:24 +00:00
public class DisplayModeCollection : IEnumerable<DisplayMode>, IEnumerable
{
private readonly List<DisplayMode> displayModes;
2011-10-31 05:36:24 +00:00
public IEnumerable<DisplayMode> this[SurfaceFormat format]
2011-10-31 05:36:24 +00:00
{
get { return displayModes.Where(current => current.Format == format).ToList(); }
2011-10-31 05:36:24 +00:00
}
internal DisplayModeCollection(List<DisplayMode> displayModes)
2011-10-31 05:36:24 +00:00
{
this.displayModes = displayModes;
2011-10-31 05:36:24 +00:00
}
public IEnumerator<DisplayMode> GetEnumerator()
2011-10-31 05:36:24 +00:00
{
return displayModes.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
2011-10-31 05:36:24 +00:00
}
}
}