Example #1
0
        /// 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);
            }
        }
Example #2
0
 /// 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();
         }
     }
 }