protected virtual void OnRowsInserted(BulkCopyEventArgs ea) { if (RowsInserted != null) { RowsInserted(this, ea); } }
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); }
protected virtual bool OnRowsInserted(BulkCopyEventArgs e) { if (RowsInserted != null) { RowsInserted(this, e); } 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(BulkCopyEventArgs e) { if (RowsInserted != null) RowsInserted(this, e); return e.Abort; }
protected virtual bool OnRowsInserted(object sender, BulkCopyEventArgs e) { return OnRowsInserted(e); }
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(object sender, BulkCopyEventArgs e) { return(OnRowsInserted(e)); }
protected virtual void OnRowsInserted(BulkCopyEventArgs ea) { if (RowsInserted != null) RowsInserted(this, ea); }
private void UpdateTaskItem(BulkCopyTask task, ListViewItem listViewItem, BulkCopyEventArgs args) { args.Abort = _abort; listViewItem.SubItems[2].Text = task.Count.ToString(); listViewItem.SubItems[3].Text = task.State.ToString(); listViewItem.SubItems[4].Text = args.Message; switch (args.Type) { case CopyEventType.Active: listViewItem.BackColor = Color.GhostWhite; listViewItem.ForeColor = Color.DarkGreen; break; case CopyEventType.Processing: listViewItem.BackColor = Color.LightCyan; listViewItem.ForeColor = Color.DarkBlue; break; case CopyEventType.Complete: if (_abort) { listViewItem.BackColor = Color.Pink; listViewItem.ForeColor = Color.DarkRed; listViewItem.SubItems[4].Text = "Aborted"; } else { listViewItem.BackColor = Color.LightGreen; listViewItem.ForeColor = Color.DarkGreen; } break; case CopyEventType.Error: listViewItem.BackColor = Color.Pink; listViewItem.ForeColor = Color.DarkRed; break; default: listViewItem.BackColor = Color.Transparent; listViewItem.ForeColor = Color.Black; break; } }