private static void CommonHandler(string chunk, StringBuilder sb, Command.LineHandler handler) { sb.Append(chunk); string[] strArray = sb.ToString().Split('\n'); if (strArray.Length < 2) { return; } for (int index = 0; index < strArray.Length - 1; ++index) { if (handler != null) { handler(strArray[index]); } } sb.Remove(0, sb.Length); sb.Append(strArray[strArray.Length - 1]); }
public void SetErrorHandler(Command.LineHandler handler) { this.userErrorHandler = handler; }
public void SetOutputHandler(Command.LineHandler handler) { this.userOutputHandler = handler; }