PowerControl: All options accept String

This commit is contained in:
Kamil Trzciński 2022-12-19 23:36:22 +01:00
parent 29e373d169
commit 81d4be30ce
17 changed files with 120 additions and 125 deletions

View file

@ -22,6 +22,13 @@ namespace PowerControl.Helpers
public DisplayResolution(int width, int height) { Width = width; Height = height; }
public DisplayResolution(String text)
{
var options = text.Split("x", 2);
Width = int.Parse(options[0]);
Height = int.Parse(options[1]);
}
public static bool operator ==(DisplayResolution sz1, DisplayResolution sz2) => sz1.Width == sz2.Width && sz1.Height == sz2.Height;
public static bool operator !=(DisplayResolution sz1, DisplayResolution sz2) => !(sz1 == sz2);