Exemplo n.º 1
0
 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();
 }
Exemplo n.º 3
0
        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);
            }
        }