Ejemplo n.º 1
0
 /// <summary>
 /// 当接收到标准输出或标准错误时调用
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnOutputReceived(OutputReceivedEventArgs e)
 {
     Task.Run(() =>
     {
         OutputReceived?.Invoke(this, e);
     });
 }
Ejemplo n.º 2
0
 protected virtual void OnOutputDataReceived(object source, OutputReceivedEventArgs e)
 {
     EventHandler<OutputReceivedEventArgs> handler = OutputDataReceived;
     if (handler != null)
     {
         handler(source, e);
     }
 }
Ejemplo n.º 3
0
 protected virtual void OnOutputDataReceived(OutputReceivedEventArgs e)
 {
     EventHandler<OutputReceivedEventArgs> handler = OutputDataReceived;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Ejemplo n.º 4
0
        protected virtual void OnOutputDataReceived(OutputReceivedEventArgs e)
        {
            EventHandler <OutputReceivedEventArgs> handler = OutputDataReceived;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 5
0
        protected virtual void OnOutputDataReceived(object source, OutputReceivedEventArgs e)
        {
            EventHandler <OutputReceivedEventArgs> handler = OutputDataReceived;

            if (handler != null)
            {
                handler(source, e);
            }
        }
Ejemplo n.º 6
0
 protected override void OnOutputReceived(OutputReceivedEventArgs e)
 {
     base.OnOutputReceived(e);
     if (!e.IsError)
     {
         _outputBuilder.AppendOut(e.Text);
     }
     else
     {
         _outputBuilder.AppendError(e.Text);
     }
 }
Ejemplo n.º 7
0
        private void OnOutputReceived(object sender, OutputReceivedEventArgs e)
        {
            IEnumerable <string> linesToSend = null;

            lock (_lock)
            {
                if (string.IsNullOrEmpty(e.Output))
                {
                    return;
                }

                _lineBuffer.ProcessText(e.Output, out linesToSend);
            }

            foreach (string line in linesToSend)
            {
                if (_isClosed)
                {
                    return;
                }

                if (line.Equals(_startCommand, StringComparison.Ordinal))
                {
                    // When logged in as root, shell sends a copy of stdin to stdout.
                    // This ignores the shell command that was used to launch the debugger.
                    continue;
                }

                int endCommandIndex = line.IndexOf(_exitMessagePrefix);
                if (endCommandIndex >= 0)
                {
                    if (Interlocked.CompareExchange(ref _firedOnExit, 1, 0) == 0)
                    {
                        string exitCode = SplitExitCode(line, endCommandIndex + _exitMessagePrefix.Length);
                        _callback.OnExit(exitCode);
                    }
                    Close();
                    return;
                }

                if (!_beginReceived)
                {
                    if (line.Contains(_beginMessage))
                    {
                        _beginReceived = true;
                    }
                    continue;
                }

                _callback.OnOutputLine(line);
            }
        }
Ejemplo n.º 8
0
 private void OnOutputReceived(object sender, OutputReceivedEventArgs e)
 {
     OutputReceived?.Invoke(sender, e?.Output);
 }
Ejemplo n.º 9
0
 private void OnOutputReceived(object sender, OutputReceivedEventArgs e)
 {
     this.OutputReceived?.Invoke(this, e);
 }
Ejemplo n.º 10
0
 protected virtual void OutputPrinter(OutputReceivedEventArgs e)
 {
     WriteLine(e.Text);
 }
 protected void OutputLogger(OutputReceivedEventArgs e)
 {
     Logger.Info(e.Text);
 }
 protected void OutputPrinter(OutputReceivedEventArgs e)
 {
     WriteLine(e.Text);
     Logger.Info(e.Text);
 }
Ejemplo n.º 13
0
 protected override Task OnDataReceived(object sender, OutputReceivedEventArgs e)
 {
     _queue.Enqueue(e.Data);
     return(Task.CompletedTask);
 }
Ejemplo n.º 14
0
 void OnLogMessage(object sender, OutputReceivedEventArgs e)
 {
     AddToOutput(e.Message);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Handles the output data received events.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The sender event args.</param>
 private static void Build_OutputDataReceived(object sender, OutputReceivedEventArgs e)
 {
     Console.Write(e.Data);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// 输出接收器
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void RaiseOutput(object sender, OutputReceivedEventArgs e)
 {
     callback?.Invoke(e);
     OutputReceived?.Invoke(this, e);
 }
Ejemplo n.º 17
0
 protected override void OutputPrinter(OutputReceivedEventArgs e)
 {
     _latestLine = e.Text;
     //base.OutputPrinter(e);
     //ParseAndShowOnUI(e.Text);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 输出接收器
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void RaiseOutput(object sender, OutputReceivedEventArgs e)
 {
     RaiseOutput(e);
 }