using System; using System.Collections.Generic; using System.Linq; using System.Text; using Aiwaz.Contracts; using SlimDX; namespace Aiwaz.Core { public class DisplayMode { public int Width { get; protected set; } public int Height { get; protected set; } public int RefreshRate { get; protected set; } public SlimDX.DXGI.Format Format { get; protected set; } public DisplayMode(SlimDX.DXGI.ModeDescription description) { this.Width = description.Width; this.Height = description.Height; this.Format = description.Format; this.RefreshRate = description.RefreshRate.Numerator == 0 ? 0 : (int)Math.Round(description.RefreshRate.Numerator / (double)description.RefreshRate.Denominator, 0, MidpointRounding.AwayFromZero); } } }