forked from RickStrahl/SetResolution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetResolutionCommandLineParser.cs
More file actions
67 lines (46 loc) · 1.8 KB
/
Copy pathSetResolutionCommandLineParser.cs
File metadata and controls
67 lines (46 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using HtmlPackager.ConsoleApp;
namespace Westwind.SetResolution
{
public class SetResolutionCommandLineParser : CommandLineParser
{
public int Width { get; set; }
public int Height { get; set; }
public int Frequency { get; set; } = 60;
public int BitCount { get; set; } = 32;
public Orientation Orientation { get; set; } = 0;
public string Profile { get; set; }
public bool Help { get; set; }
public bool StartTray { get; set; }
public bool CreateProfile { get; set; }
public bool ShowResolutions { get; set; }
public bool ListAll { get; set; }
public int MonitorId { get; set; }
/// <summary>
/// Don't ask for confirmation
/// </summary>
public bool NoPrompt { get; set; }
public bool NoPersist { get; set; }
public SetResolutionCommandLineParser(string[] args = null, string cmdLine = null)
: base(args, cmdLine)
{
}
public override void Parse()
{
Width = ParseIntParameterSwitch("-w", 0);
Height = ParseIntParameterSwitch("-h", 0);
Frequency = ParseIntParameterSwitch("-f", 60);
BitCount = ParseIntParameterSwitch("-b", 32);
int or = ParseIntParameterSwitch("-o", 0);
Orientation = (Orientation) or;
ListAll = ParseParameterSwitch("-la");
Profile = ParseStringParameterSwitch("-p");
MonitorId = ParseIntParameterSwitch("-m");
NoPrompt = ParseParameterSwitch("-noprompt");
NoPersist = ParseParameterSwitch("-nopersist");
Help = ParseParameterSwitch("-h");
}
}
}