Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ProcessStartInfo.cs
Go to the documentation of this file.
7using System.IO;
10using System.Text;
11using Microsoft.Win32;
12
13namespace System.Diagnostics;
14
15[DebuggerDisplay("FileName={FileName}, Arguments={BuildArguments()}, WorkingDirectory={WorkingDirectory}")]
16public sealed class ProcessStartInfo
17{
18 private string _fileName;
19
20 private string _arguments;
21
22 private string _directory;
23
24 private string _userName;
25
26 private string _verb;
27
29
31
33
34 private string _domain;
35
36 public string Arguments
37 {
38 get
39 {
40 return _arguments ?? string.Empty;
41 }
43 set
44 {
46 }
47 }
48
50
51 internal bool HasArgumentList
52 {
53 get
54 {
55 if (_argumentList != null)
56 {
57 return _argumentList.Count != 0;
58 }
59 return false;
60 }
61 }
62
63 public bool CreateNoWindow { get; set; }
64
65 [Editor("System.Diagnostics.Design.StringDictionaryEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
67
86
87 public bool RedirectStandardInput { get; set; }
88
89 public bool RedirectStandardOutput { get; set; }
90
91 public bool RedirectStandardError { get; set; }
92
93 public Encoding? StandardInputEncoding { get; set; }
94
95 public Encoding? StandardErrorEncoding { get; set; }
96
97 public Encoding? StandardOutputEncoding { get; set; }
98
99 [Editor("System.Diagnostics.Design.StartFileNameEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
100 public string FileName
101 {
102 get
103 {
104 return _fileName ?? string.Empty;
105 }
107 set
108 {
110 }
111 }
112
113 [Editor("System.Diagnostics.Design.WorkingDirectoryEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
114 public string WorkingDirectory
115 {
116 get
117 {
118 return _directory ?? string.Empty;
119 }
121 set
122 {
124 }
125 }
126
127 public bool ErrorDialog { get; set; }
128
129 public IntPtr ErrorDialogParentHandle { get; set; }
130
131 public string UserName
132 {
133 get
134 {
135 return _userName ?? string.Empty;
136 }
138 set
139 {
141 }
142 }
143
144 [DefaultValue("")]
145 public string Verb
146 {
147 get
148 {
149 return _verb ?? string.Empty;
150 }
152 set
153 {
154 _verb = value;
155 }
156 }
157
158 [DefaultValue(ProcessWindowStyle.Normal)]
160 {
161 get
162 {
163 return _windowStyle;
164 }
165 set
166 {
168 {
170 }
172 }
173 }
174
175 [SupportedOSPlatform("windows")]
176 public string? PasswordInClearText { get; set; }
177
178 [SupportedOSPlatform("windows")]
179 public string Domain
180 {
181 get
182 {
183 return _domain ?? string.Empty;
184 }
186 set
187 {
188 _domain = value;
189 }
190 }
191
192 [SupportedOSPlatform("windows")]
193 public bool LoadUserProfile { get; set; }
194
195 [CLSCompliant(false)]
196 [SupportedOSPlatform("windows")]
197 public SecureString? Password { get; set; }
198
199 public string[] Verbs
200 {
201 get
202 {
204 if (string.IsNullOrEmpty(extension))
205 {
206 return Array.Empty<string>();
207 }
208 using RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(extension);
209 if (registryKey == null)
210 {
211 return Array.Empty<string>();
212 }
213 string text = registryKey.GetValue(string.Empty) as string;
214 if (string.IsNullOrEmpty(text))
215 {
216 return Array.Empty<string>();
217 }
218 using RegistryKey registryKey2 = Registry.ClassesRoot.OpenSubKey(text + "\\shell");
219 if (registryKey2 == null)
220 {
221 return Array.Empty<string>();
222 }
223 string[] subKeyNames = registryKey2.GetSubKeyNames();
225 string[] array = subKeyNames;
226 foreach (string text2 in array)
227 {
228 if (!string.Equals(text2, "new", StringComparison.OrdinalIgnoreCase))
229 {
230 list.Add(text2);
231 }
232 }
233 return list.ToArray();
234 }
235 }
236
237 public bool UseShellExecute { get; set; }
238
240 {
241 }
242
244 {
246 }
247
248 public ProcessStartInfo(string fileName, string arguments)
249 {
252 }
253
254 internal string BuildArguments()
255 {
256 if (HasArgumentList)
257 {
261 return stringBuilder.ToString();
262 }
263 return Arguments;
264 }
265
267 {
268 if (_argumentList != null && _argumentList.Count > 0)
269 {
270 foreach (string argument in _argumentList)
271 {
273 }
274 return;
275 }
276 if (!string.IsNullOrEmpty(Arguments))
277 {
278 if (stringBuilder.Length > 0)
279 {
280 stringBuilder.Append(' ');
281 }
282 stringBuilder.Append(Arguments);
283 }
284 }
285}
void Add(TKey key, TValue value)
ProcessStartInfo(string fileName, string arguments)
void AppendArgumentsTo(ref System.Text.ValueStringBuilder stringBuilder)
static bool IsDefined(Type enumType, object value)
Definition Enum.cs:359
static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target)
static ? string GetExtension(string? path)
Definition Path.cs:168
static void AppendArgument(ref System.Text.ValueStringBuilder stringBuilder, string argument)
static StringComparer Ordinal
static StringComparer OrdinalIgnoreCase