/// Progress event handler public void OnOutputProgress(object sender, OperationProgressEventArgs e) { ScriptContext ctx = (ScriptContext)sender; if (e.PercentCompleted == 0) { ctx.WriteLine(OutputType.Debug, "@ " + ctx.CallStack.StackTraceFlat); } }
/// Execute progress handler protected void OnProgressInternal(int percentCompleted, string extra) { CheckAbort(); if (Progress != null) { OperationProgressEventArgs args = new OperationProgressEventArgs { PercentCompleted = percentCompleted, ExtraData = extra }; Progress(this, args); if (args.Cancel && !_abortStarted) { Abort(); CheckAbort(); } } }