示例#1
0
 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;
 }
示例#2
0
 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;
 }