public BulkCopyEventArgs(CopyEventType type, Guid id, string message, long count) { Count = count; Type = type; Message = message; Id = id; }
protected virtual bool OnRowsInserted(BulkCopyEventArgs e) { bool hasErrors = false; bool isComplete = true; foreach (BulkCopyTask task in this) { if (task.State == CopyEventType.Error) { hasErrors = true; } if (task.State != CopyEventType.Error && task.State != CopyEventType.Complete) { isComplete = false; } } _state = isComplete ? hasErrors ? CopyEventType.Error : CopyEventType.Complete : CopyEventType.Active; _state = isComplete ? hasErrors ? CopyEventType.Error : CopyEventType.Complete : CopyEventType.Active; if (RowsInserted != null) { RowsInserted(null, e); } if (_state == CopyEventType.Complete || _state == CopyEventType.Error) { OnComplete(); } return(e.Abort); }
public virtual bool OnRowsInserted(CopyEventType type, string message) { _state = type; BulkCopyEventArgs ea = new BulkCopyEventArgs(type, Id, message, _count); if (RowsInserted != null) { RowsInserted(null, ea); } return(ea.Abort); }
protected virtual bool OnRowsInserted(CopyEventType type) { return OnRowsInserted(type, string.Empty); }
public virtual bool OnRowsInserted(CopyEventType type, string message) { _state = type; BulkCopyEventArgs ea = new BulkCopyEventArgs(type, Id, message, _count); if (RowsInserted != null) RowsInserted(null, ea); return ea.Abort; }
protected virtual bool OnRowsInserted(CopyEventType type) { return(OnRowsInserted(type, string.Empty)); }