-
-
Notifications
You must be signed in to change notification settings - Fork 748
Expand file tree
/
Copy pathRunnerParams.cs
More file actions
163 lines (135 loc) · 4.11 KB
/
RunnerParams.cs
File metadata and controls
163 lines (135 loc) · 4.11 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
namespace ElectronNET.Common
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
public sealed class RunnerParams
{
private string fileName;
private string arguments;
private string directory;
private string userName;
private string verb;
private ProcessWindowStyle windowStyle;
/// <summary>
/// Default constructor. At least the <see cref='ProcessStartInfo.FileName'/>
/// property must be set before starting the process.
/// </summary>
public RunnerParams()
{
}
/// <summary>
/// Specifies the name of the application or document that is to be started.
/// </summary>
public RunnerParams(string fileName)
{
this.fileName = fileName;
}
/// <summary>
/// Specifies the name of the application that is to be started, as well as a set
/// of command line arguments to pass to the application.
/// </summary>
public RunnerParams(string fileName, string arguments)
{
this.fileName = fileName;
this.arguments = arguments;
}
/// <summary>
/// Specifies the set of command line arguments to use when starting the application.
/// </summary>
public string Arguments
{
get
{
return this.arguments ?? string.Empty;
}
set
{
this.arguments = value;
}
}
public bool CreateNoWindow { get; set; }
public Dictionary<string, string> EnvironmentVariables { get; set; } = new Dictionary<string, string>();
public bool RedirectStandardInput { get; set; }
public bool RedirectStandardOutput { get; set; }
public bool RedirectStandardError { get; set; }
public Encoding StandardInputEncoding { get; set; }
public Encoding StandardErrorEncoding { get; set; }
public Encoding StandardOutputEncoding { get; set; }
/// <summary>
/// <para>
/// Returns or sets the application, document, or URL that is to be launched.
/// </para>
/// </summary>
public string FileName
{
get
{
return this.fileName ?? string.Empty;
}
set
{
this.fileName = value;
}
}
/// <summary>
/// Returns or sets the initial directory for the process that is started.
/// Specify "" to if the default is desired.
/// </summary>
public string WorkingDirectory
{
get
{
return this.directory ?? string.Empty;
}
set
{
this.directory = value;
}
}
public bool ErrorDialog { get; set; }
public IntPtr ErrorDialogParentHandle { get; set; }
public string UserName
{
get
{
return this.userName ?? string.Empty;
}
set
{
this.userName = value;
}
}
[DefaultValue("")]
public string Verb
{
get
{
return this.verb ?? string.Empty;
}
set
{
this.verb = value;
}
}
[DefaultValue(ProcessWindowStyle.Normal)]
public ProcessWindowStyle WindowStyle
{
get
{
return this.windowStyle;
}
set
{
if (!Enum.IsDefined(typeof(ProcessWindowStyle), value))
{
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(ProcessWindowStyle));
}
this.windowStyle = value;
}
}
public bool UseShellExecute { get; set; }
}
}