public ConsoleSession(CancellationToken ct, string exe, params string[] args) : base(ct) { Exe = exe ?? throw new ArgumentNullException("exe"); Args = args; Process = new ConsoleProcess(Exe, Args.ToArray(), onOutput: OnProcessOutput, onError: OnErrorOutput); Initialized = Process.Initialized; }
public void Start() { if (IsStarted) { throw new InvalidOperationException("The Julius session is already started."); } else if (IsStopped) { Process = new ConsoleProcess(Exe, Args, onOutput: OnProcessOutput, onError: OnErrorOutput); } Process.Start(); IsStarted = true; }