1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-04 22:35:37 +01:00
GiantsTools/Giants.Launcher/ScreenResolution.cs

38 lines
915 B
C#
Raw Normal View History

2020-08-10 06:58:51 +02:00
using System;
namespace Giants.Launcher
{
class ScreenResolution : IComparable
2020-08-13 06:58:53 +02:00
{
public int Width { get; set; }
public int Height { get; set; }
2020-08-10 06:58:51 +02:00
2020-08-13 06:58:53 +02:00
public ScreenResolution(int width, int height)
{
this.Width = width;
this.Height = height;
2020-08-13 06:58:53 +02:00
}
2020-08-10 06:58:51 +02:00
2020-08-13 06:58:53 +02:00
public int CompareTo(object obj)
{
if (obj == null) return 1;
2020-08-10 06:58:51 +02:00
2020-08-13 06:58:53 +02:00
ScreenResolution other = obj as ScreenResolution;
if (other == null)
throw new ArgumentException();
2020-08-10 06:58:51 +02:00
2020-08-13 06:58:53 +02:00
if (this.Width > other.Width)
return 1;
else if (this.Width == other.Width && this.Height == other.Height)
return 0;
else
return -1;
}
2020-08-10 06:58:51 +02:00
2020-08-13 06:58:53 +02:00
public override string ToString()
{
return string.Format("{0}x{1}", this.Width, this.Height);
}
}
2020-08-10 06:58:51 +02:00
}