Mono.Debugger.Test.Framework.LineReader.Add C# (CSharp) Method

Add() public method

public Add ( string text ) : void
text string
return void
        public void Add(string text)
        {
            lock (queue.SyncRoot) {
            again:
                int pos = text.IndexOf ('\n');
                if (pos < 0)
                    current_line += text;
                else {
                    current_line += text.Substring (0, pos);
                    queue.Enqueue (current_line);
                    current_line = "";
                    text = text.Substring (pos + 1);
                    if (text.Length > 0)
                        goto again;
                }

                wait_event.Set ();
            }
        }

Usage Example

Ejemplo n.º 1
0
 protected override void OnTargetOutput(bool is_stderr, string line)
 {
     if (is_stderr)
     {
         inferior_stderr.Add(line);
     }
     else
     {
         inferior_stdout.Add(line);
     }
 }
LineReader