public void ReportProgress(TaskProgressChangedEventArgs e) { e.Instance = this; e.Percent = e.Percent > 100 ? 100 : e.Percent; e.Percent = e.Percent < 0 ? 0 : e.Percent; TryStop(); OnProgressChanged(e); if (ProgressChanged != null) { ProgressChanged(this, e); } }
public static void ReportProgress(this ITask source, int percent, object userState = null) { TaskProgressChangedEventArgs e = new TaskProgressChangedEventArgs(percent, userState); source.ReportProgress(e); }
protected virtual void OnProgressChanged(TaskProgressChangedEventArgs e) { }
protected virtual void OnProgressChanged(TaskDelegateMetadata meta, TaskProgressChangedEventArgs progressChanged) { throw new NotImplementedException(); }