private void onExtractorInvoked(object sender, ExtractorInvokedEventArgs e) { if (e.HasError) { this.result = new InvokeResult(e.Error); } else { this.result = new InvokeResult(); } this.nfsReadBlock.Set(); }
private void onExtractorInvoked(object sender, ExtractorInvokedEventArgs e) { if (e.HasError) { this.result = new InvokeResult(e.Error); } else { this.result = new InvokeResult(e.HasOutput ? e.Output : Enumerable.Empty <string>()); } this.nfsReadBlock.Set(); }
private void onProcessExiting(object sender, EventArgs e) { var process = (Process)sender; process.CancelErrorRead(); process.CancelOutputRead(); this.currentProcess = null; var outputs = this.outputDatas.ToArray(); string errors = this.errorBuilder.Length > 0 ? this.errorBuilder.ToString() : null; this.outputDatas.Clear(); this.errorBuilder.Clear(); if (this.ExtractorInvoked != null) { var args = new ExtractorInvokedEventArgs(outputs, errors); this.ExtractorInvoked(this, args); } }