Skip to content

Commit

Permalink
Providing option to hide command prompt window for driver service exe…
Browse files Browse the repository at this point in the history
…cutables in .NET bindings
  • Loading branch information
jimevans committed Dec 22, 2013
1 parent 339f39a commit bd0e4ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dotnet/src/webdriver/DriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public abstract class DriverService : IDisposable
private string driverServiceExecutableName;
private int driverServicePort;
private bool silent;
private bool hideCommandPromptWindow;
private Process driverServiceProcess;

/// <summary>
Expand Down Expand Up @@ -108,6 +109,15 @@ public bool IsRunning
get { return this.driverServiceProcess != null && !this.driverServiceProcess.HasExited; }
}

/// <summary>
/// Gets or sets a value indicating whether the command prompt window of the service should be hidden.
/// </summary>
public bool HideCommandPromptWindow
{
get { return this.hideCommandPromptWindow; }
set { this.hideCommandPromptWindow = value; }
}

/// <summary>
/// Gets the executable file name of the driver service.
/// </summary>
Expand Down Expand Up @@ -143,6 +153,7 @@ public void Start()
this.driverServiceProcess.StartInfo.FileName = Path.Combine(this.driverServicePath, this.driverServiceExecutableName);
this.driverServiceProcess.StartInfo.Arguments = this.CommandLineArguments;
this.driverServiceProcess.StartInfo.UseShellExecute = false;
this.driverServiceProcess.StartInfo.CreateNoWindow = this.hideCommandPromptWindow;
this.driverServiceProcess.Start();
Uri serviceHealthUri = new Uri(this.ServiceUrl, new Uri("status", UriKind.Relative));
bool processStarted = false;
Expand Down

0 comments on commit bd0e4ef

Please sign in to comment.