示例#1
0
 protected virtual void OnRowsInserted(BulkCopyEventArgs ea)
 {
     if (RowsInserted != null)
     {
         RowsInserted(this, ea);
     }
 }
示例#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);
        }
示例#3
0
 protected virtual bool OnRowsInserted(BulkCopyEventArgs e)
 {
     if (RowsInserted != null)
     {
         RowsInserted(this, e);
     }
     return(e.Abort);
 }
示例#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);
        }
示例#5
0
 protected virtual bool OnRowsInserted(BulkCopyEventArgs e)
 {
     if (RowsInserted != null)
         RowsInserted(this, e);
     return e.Abort;
 }
示例#6
0
 protected virtual bool OnRowsInserted(object sender, BulkCopyEventArgs e)
 {
     return OnRowsInserted(e);
 }
示例#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;
 }
示例#8
0
 protected virtual bool OnRowsInserted(object sender, BulkCopyEventArgs e)
 {
     return(OnRowsInserted(e));
 }
示例#9
0
 protected virtual void OnRowsInserted(BulkCopyEventArgs ea)
 {
     if (RowsInserted != null)
         RowsInserted(this, ea);
 }
示例#10
0
文件: frmUI.cs 项目: JXPrime/soddi
        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;
            }
        }