-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParams.cs
82 lines (79 loc) · 1.74 KB
/
Params.cs
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
namespace App {
class Params {
// data
/// <summary>
/// Defines output name of shortcut.
/// </summary>
public string Output;
/// <summary>
/// Defines path of the target.
/// </summary>
public string TargetPath;
/// <summary>
/// Defines window style of target.
/// </summary>
public string WindowStyle;
/// <summary>
/// Defines hot-key to start the target.
/// </summary>
public string HotKey;
/// <summary>
/// Defines icon location for target.
/// </summary>
public string IconLocation;
/// <summary>
/// Defines description of the target.
/// </summary>
public string Description;
/// <summary>
/// Defines working directory of the target.
/// </summary>
public string WorkingDirectory;
/// <summary>
/// Defines input arguments for the target.
/// </summary>
public string Arguments;
// constructor
/// <summary>
/// Get parameters from input arguments.
/// </summary>
/// <param name="args">Input arguments.</param>
public Params(string[] args) {
for(int i=0; i<args.Length; i++) {
switch(args[i]) {
case "-o":
case "--output":
Output = args[++i];
break;
case "-s":
case "--window-style":
WindowStyle = args[++i];
break;
case "-k":
case "--hot-key":
HotKey = args[++i];
break;
case "-i":
case "--icon-location":
IconLocation = args[++i];
break;
case "-d":
case "--description":
Description = args[++i];
break;
case "-w":
case "--working-directory":
WorkingDirectory = args[++i];
break;
case "-a":
case "--arguments":
Arguments = args[++i];
break;
default:
TargetPath = args[i];
break;
}
}
}
}
}