Author: ankit
Date: 2007-01-18 08:06:08 -0500 (Thu, 18 Jan 2007)
New Revision: 71256

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
Log:
* MonoDevelop.Core.Execution/ProcessService.cs (StartProcess): Add new
overload that takes a ProcessStartInfo.
(CreateProcessStartInfo): New.


Modified: trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog       2007-01-18 
12:42:24 UTC (rev 71255)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog       2007-01-18 
13:06:08 UTC (rev 71256)
@@ -1,3 +1,9 @@
+2007-01-18  Ankit Jain  <[EMAIL PROTECTED]>
+
+       * MonoDevelop.Core.Execution/ProcessService.cs (StartProcess): Add new
+       overload that takes a ProcessStartInfo.
+       (CreateProcessStartInfo): New.
+
 2007-01-18  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Core/FileService.cs: Fire events in the correct order

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
    2007-01-18 12:42:24 UTC (rev 71255)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
    2007-01-18 13:06:08 UTC (rev 71256)
@@ -57,11 +57,14 @@
 
                public ProcessWrapper StartProcess (string command, string 
arguments, string workingDirectory, ProcessEventHandler outputStreamChanged, 
ProcessEventHandler errorStreamChanged, EventHandler exited, bool 
redirectStandardInput)
                {
-                       if (command == null)
-                               throw new ArgumentNullException("command");
-                       
-                       if (command.Length == 0)
-                               throw new ArgumentException("command");
+                       return StartProcess (CreateProcessStartInfo (command, 
arguments, workingDirectory, redirectStandardInput), 
+                               outputStreamChanged, errorStreamChanged, 
exited);
+               }
+
+               public ProcessWrapper StartProcess (ProcessStartInfo startInfo, 
ProcessEventHandler outputStreamChanged, ProcessEventHandler 
errorStreamChanged, EventHandler exited)
+               {
+                       if (startInfo == null)
+                               throw new ArgumentException ("startInfo");
                
                        ProcessWrapper p = new ProcessWrapper();
 
@@ -75,23 +78,36 @@
                        if (exited != null)
                                p.Exited += exited;
                                
+                       p.StartInfo = startInfo;
+                       p.EnableRaisingEvents = true;
+                       
+                       p.Start ();
+                       return p;
+               }
+
+               public ProcessStartInfo CreateProcessStartInfo (string command, 
string arguments, string workingDirectory, bool redirectStandardInput)
+               {
+                       if (command == null)
+                               throw new ArgumentNullException("command");
+                       
+                       if (command.Length == 0)
+                               throw new ArgumentException("command");
+               
+                       ProcessStartInfo startInfo = null;
                        if(String.IsNullOrEmpty (arguments))
-                               p.StartInfo = new ProcessStartInfo (command);
+                               startInfo = new ProcessStartInfo (command);
                        else
-                               p.StartInfo = new ProcessStartInfo (command, 
arguments);
+                               startInfo = new ProcessStartInfo (command, 
arguments);
                        
                        if(workingDirectory != null && workingDirectory.Length 
> 0)
-                               p.StartInfo.WorkingDirectory = workingDirectory;
+                               startInfo.WorkingDirectory = workingDirectory;
 
+                       startInfo.RedirectStandardOutput = true;
+                       startInfo.RedirectStandardError = true;
+                       startInfo.RedirectStandardInput = redirectStandardInput;
+                       startInfo.UseShellExecute = false;
 
-                       p.StartInfo.RedirectStandardOutput = true;
-                       p.StartInfo.RedirectStandardError = true;
-                       p.StartInfo.RedirectStandardInput = 
redirectStandardInput;
-                       p.StartInfo.UseShellExecute = false;
-                       p.EnableRaisingEvents = true;
-                       
-                       p.Start ();
-                       return p;
+                       return startInfo;
                }
                
                public ProcessWrapper StartConsoleProcess (string command, 
string arguments, string workingDirectory, IConsole console, EventHandler 
exited)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to