Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -47,12 +47,12 @@ namespace System.Diagnostics
public sealed class ProcessStartInfo
{
/* keep these fields in this order and in sync with metadata/process.h */
private string arguments = "";
private string arguments;
private IntPtr error_dialog_parent_handle = (IntPtr)0;
private string filename = "";
private string verb = "";
private string working_directory = "";
private ProcessStringDictionary envVars;
private string filename;
private string verb;
private string working_directory;
private StringDictionary envVars;
private bool create_no_window = false;
private bool error_dialog = false;
private bool redirect_standard_error = false;
@@ -87,7 +87,7 @@ namespace System.Diagnostics
[NotifyParentPropertyAttribute (true)]
public string Arguments {
get {
return(arguments);
return arguments ?? string.Empty;
}
set {
arguments = value;
@@ -113,7 +113,15 @@ namespace System.Diagnostics
public StringDictionary EnvironmentVariables {
get {
if (envVars == null) {
envVars = new ProcessStringDictionary ();
// check for non-Unix platforms - see FAQ for more details
// http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F
int platform = (int) Environment.OSVersion.Platform;
if ((platform != 4) && (platform != 128)) {
envVars = new StringDictionary ();
} else {
envVars = new CaseSensitiveStringDictionary ();
}
foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables ())
envVars.Add ((string) entry.Key, (string) entry.Value);
}
@@ -155,7 +163,7 @@ namespace System.Diagnostics
[NotifyParentPropertyAttribute (true)]
public string FileName {
get {
return(filename);
return filename ?? string.Empty;
}
set {
filename = value;
@@ -187,7 +195,7 @@ namespace System.Diagnostics
}
[DefaultValue (false)]
[MonitoringDescription ("Standart output of this process is redirected.")]
[MonitoringDescription ("Standard output of this process is redirected.")]
[NotifyParentPropertyAttribute (true)]
public bool RedirectStandardOutput {
get {
@@ -226,7 +234,7 @@ namespace System.Diagnostics
[NotifyParentPropertyAttribute (true)]
public string Verb {
get {
return(verb);
return verb ?? string.Empty;
}
set {
verb = value;
@@ -238,21 +246,20 @@ namespace System.Diagnostics
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden), Browsable (false)]
public string[] Verbs {
get {
string ext = filename == null | filename.Length == 0 ?
null : Path.GetExtension (filename);
if (ext == null)
return empty;
#if MOBILE
return empty;
#else
switch (Environment.OSVersion.Platform) {
case (PlatformID)4:
case (PlatformID)6:
case (PlatformID)128:
return empty; // no verb on non-Windows
default:
string ext = filename == null | filename.Length == 0 ?
null : Path.GetExtension (filename);
if (ext == null)
return empty;
RegistryKey rk = null, rk2 = null, rk3 = null;
try {
rk = Registry.ClassesRoot.OpenSubKey (ext);
@@ -292,10 +299,10 @@ namespace System.Diagnostics
[NotifyParentPropertyAttribute (true)]
public string WorkingDirectory {
get {
return(working_directory);
return working_directory ?? string.Empty;
}
set {
working_directory = value == null ? String.Empty : value;
working_directory = value;
}
}
@@ -307,13 +314,13 @@ namespace System.Diagnostics
[NotifyParentPropertyAttribute (true)]
public string UserName {
get { return username; }
get { return username ?? string.Empty; }
set { username = value; }
}
[NotifyParentPropertyAttribute (true)]
public string Domain {
get { return domain; }
get { return domain ?? string.Empty; }
set { domain = value; }
}