/// <summary> /// Initializes a new instance of the <see cref="SingleKdbPlusProcess"/> class. /// </summary> /// <param name="processName">Name of the process.</param> /// <param name="host">The host.</param> /// <param name="port">The port.</param> /// <param name="commandLine">The command line.</param> /// <param name="processTitle">The process title.</param> /// <param name="workingDirectory">The working directory.</param> /// <param name="logger">The logger.</param> /// <param name="storage">The storage.</param> /// <param name="preStartCommands">The pre-start commands.</param> /// <param name="setupCommands">The setup commands.</param> /// <param name="hideWindow">if set to <c>true</c> [hide window].</param> /// <param name="waitForPortTimeOut">The wait for port time out.</param> /// <param name="useShellExecute">Use ShellExecute when starting the process</param> /// <param name="numberOfCoresToUse">Number of cores for process to use. 0 if there is no limit</param> public SingleKdbPlusProcess(string processName, string host, int port, string commandLine, string processTitle, string workingDirectory, ILogger logger, ISettingsStorage storage, List <Action> preStartCommands, List <Action <IDatabaseClient> > setupCommands, bool hideWindow, TimeSpan waitForPortTimeOut, bool useShellExecute, int numberOfCoresToUse) { Guard.ThrowIfNull(logger, "logger"); Guard.ThrowIfNull(storage, "storage"); Guard.ThrowIfNull(setupCommands, "setupCommands"); Guard.ThrowIfNull(preStartCommands, "preStartCommands"); Guard.ThrowIfNullOrEmpty(processName, "processName"); Guard.ThrowIfNullOrEmpty(host, "host"); Guard.ThrowIfNullOrEmpty(workingDirectory, "workingDirectory"); Guard.ThrowIfNullOrEmpty(commandLine, "commandLine"); _logger = logger; _storage = storage; _processName = processName; _host = host; _port = port; _workingDirectory = workingDirectory; _commandLine = commandLine; _processTitle = processTitle; _processKey = string.Format("{0}_{1}", _host, _port); _id = _storage.GetProcessId(_processKey); if (string.IsNullOrWhiteSpace(_processTitle)) { _processTitle = _processKey; } _setupCommands = setupCommands; _preStartCommands = preStartCommands; _hideWindow = hideWindow; _waitForPortTimeout = waitForPortTimeOut; _useShellExecute = useShellExecute; _numberOfCoresToUse = numberOfCoresToUse; }