Example #1
0
 public BulkCopyEventArgs(CopyEventType type, Guid id, string message, long count)
 {
     Count   = count;
     Type    = type;
     Message = message;
     Id      = id;
 }
Example #2
0
        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);
        }
Example #3
0
 public BulkCopyEventArgs(CopyEventType type, Guid id, string message, long count)
 {
     Count = count;
     Type = type;
     Message = message;
     Id = id;
 }
Example #4
0
        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);
        }
Example #5
0
 protected virtual bool OnRowsInserted(CopyEventType type)
 {
     return OnRowsInserted(type, string.Empty);
 }
Example #6
0
 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;
 }
Example #7
0
 protected virtual bool OnRowsInserted(CopyEventType type)
 {
     return(OnRowsInserted(type, string.Empty));
 }