Method RunAndFetchLines
- Namespace
- Zyl.VectorTraits.Impl.Util
- Assembly
- VectorTraits.dll
RunAndFetchLines(Func<bool, string, bool>, string, string, bool, Func<object, bool>?)
Run and fetch text lines (运行与获取每行文本)
public static int RunAndFetchLines(Func<bool, string, bool> onFetch, string fileName, string arguments = "", bool allowError = false, Func<object, bool>? onBefore = null)
Parameters
onFetch
Func<bool, string, bool>The callback function of fetch line text (获取单行文本的回调函数). Prototype:
bool isBreak = onFetch(bool isError, string line)
. OperationCanceledException is cancel, other is throw.fileName
stringThe application or document to start (启动的应用程序或文档).
arguments
stringCommand-line arguments to use when starting the application(启动应用程序时要使用的一组命令行参数).
allowError
boolWhether to allow output error streams(是否允许输出错误流).
onBefore
Func<object, bool>The callback function of before run (运行之前的回调函数). Prototype:
bool isBreak = onBefore(object processObj)
. OperationCanceledException is cancel, other is throw.