private void du_onCompleted(object sender, CompletedEventArgs e) { IProgressable d = (IProgressable)sender; OperationInfo op = (OperationInfo)d.State; if (e.Success) { op.status = OperationStatus.Success; } else if (op.status == OperationStatus.Processing) { if (e.Cancel) { op.status = OperationStatus.Cancel; } else { op.status = OperationStatus.Fail; op.errmsg = e.Exception == null ? string.Empty : e.Exception.Message; } } }
private void du_onCompleted(object sender, CompletedEventArgs e) { IProgressable d = (IProgressable)sender; OperationInfo op = (OperationInfo)d.State; if (e.Success) op.status = OperationStatus.Success; else if (op.status == OperationStatus.Processing) { if (e.Cancel) op.status = OperationStatus.Cancel; else { op.status = OperationStatus.Fail; op.errmsg = e.Exception == null ? string.Empty : e.Exception.Message; } } }
protected virtual void fireCompleted(CompletedEventArgs args) { if (Completed != null) Completed(this, args); }