[System.Diagnostics] Change resource ProcessStartIdentityNotSupported name and conten...
authorYurij Kadirov <admin@sirkadirov.com>
Sat, 18 Aug 2018 13:47:51 +0000 (16:47 +0300)
committerEric Erhardt <eric.erhardt@microsoft.com>
Sat, 18 Aug 2018 13:47:51 +0000 (08:47 -0500)
* ProcessStartIdentityNotSupported renamed

* Fix dotnet/corefx#31735

- Changed resource name because of obtaining support for some functions
- Changed resource text to give more information about current features support

* Change resource names due to ProcessStartIdentityNotSupported rename

* Create user-friendly message for unsupported System.Diagnostics.Process features

* User-friendly messages for unsupported System.Diagnostics.Process features

* User-friendly messages for unsupported System.Diagnostics.Process features

* Split ProcessStart NotSupported message into two for localization

* Localization enhancements due to some reviews for Process.Start methods

* Localization enhancements for unsupported ProsessStartInfo parameters

* Starting process -> Starting a process fix

* "...user with A specified password and.." fix

* Use method SR.Format() than using string.Format() for compatibility

Commit migrated from https://github.com/dotnet/corefx/commit/4c314da457b550859e74f1f10f57d41b5fa07ca5

src/libraries/System.Diagnostics.Process/src/Resources/Strings.resx
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Unix.cs

index 59e578f..76723e4 100644 (file)
   <data name="ProcessorAffinityNotSupported" xml:space="preserve">
     <value>Processor affinity for processes or threads is not supported on this platform.</value>
   </data>
-  <data name="ProcessStartIdentityNotSupported" xml:space="preserve">
-    <value>Starting a process with a different identity is not supported on this platform.</value>
+  <data name="ProcessStartWithPasswordAndDomainNotSupported" xml:space="preserve">
+    <value>Starting a process as another user with a specified password and domain is not supported on this platform.</value>
+  </data>
+  <data name="ProcessStartSingleFeatureNotSupported" xml:space="preserve">
+    <value>The {0} property is not supported on this platform.</value>
   </data>
   <data name="RUsageFailure" xml:space="preserve">
     <value>Failed to set or retrieve rusage information. See the error code for OS-specific error information.</value>
   <data name="ArgumentAndArgumentListInitialized" xml:space="preserve">
     <value>Only one of Arguments or ArgumentList may be used.</value>
   </data>
-</root>
\ No newline at end of file
+</root>
index 4bfc348..1042f43 100644 (file)
@@ -44,13 +44,13 @@ namespace System.Diagnostics
         [CLSCompliant(false)]
         public static Process Start(string fileName, string userName, SecureString password, string domain)
         {
-            throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported);
+            throw new PlatformNotSupportedException(SR.ProcessStartWithPasswordAndDomainNotSupported);
         }
 
         [CLSCompliant(false)]
         public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain)
         {
-            throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported);
+            throw new PlatformNotSupportedException(SR.ProcessStartWithPasswordAndDomainNotSupported);
         }
 
         /// <summary>Stops the associated process immediately.</summary>
index d941633..daaf2ec 100644 (file)
@@ -16,20 +16,20 @@ namespace System.Diagnostics
 
         public string PasswordInClearText
         {
-            get { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
-            set { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
+            get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(PasswordInClearText))); }
+            set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(PasswordInClearText))); }
         }
 
         public string Domain
         {
-            get { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
-            set { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
+            get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Domain))); }
+            set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Domain))); }
         }
 
         public bool LoadUserProfile
         {
-            get { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
-            set { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
+            get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(LoadUserProfile))); }
+            set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(LoadUserProfile))); }
         }
 
         public bool UseShellExecute { get; set; }
@@ -39,8 +39,8 @@ namespace System.Diagnostics
         [CLSCompliant(false)]
         public SecureString Password
         {
-            get { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
-            set { throw new PlatformNotSupportedException(SR.ProcessStartIdentityNotSupported); }
+            get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Password))); }
+            set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Password))); }
         }
     }
 }