Exemple #1
0
 protected virtual void OnRowsInserted(BulkCopyEventArgs ea)
 {
     if (RowsInserted != null)
     {
         RowsInserted(this, ea);
     }
 }
Exemple #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);
        }
Exemple #3
0
 protected virtual bool OnRowsInserted(BulkCopyEventArgs e)
 {
     if (RowsInserted != null)
     {
         RowsInserted(this, e);
     }
     return(e.Abort);
 }
Exemple #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);
        }
Exemple #5
0
 protected virtual bool OnRowsInserted(BulkCopyEventArgs e)
 {
     if (RowsInserted != null)
         RowsInserted(this, e);
     return e.Abort;
 }
Exemple #6
0
 protected virtual bool OnRowsInserted(object sender, BulkCopyEventArgs e)
 {
     return OnRowsInserted(e);
 }
Exemple #7
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;
 }
Exemple #8
0
 protected virtual bool OnRowsInserted(object sender, BulkCopyEventArgs e)
 {
     return(OnRowsInserted(e));
 }
Exemple #9
0
 protected virtual void OnRowsInserted(BulkCopyEventArgs ea)
 {
     if (RowsInserted != null)
         RowsInserted(this, ea);
 }
Exemple #10
0
        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;
            }
        }