Ejemplo n.º 1
0
 // 数据进度委托,以便在UI线程中同步
 /// <summary>
 /// 数据进度委托,以便在UI线程中同步
 /// </summary>
 private void set_pe(ExportProgressArgs e)
 {
     if (_sc != null && _up_e != null)
     {
         _sc.Send(_up_e, e);
     }
 }
Ejemplo n.º 2
0
        // 数据输出进度显示
        /// <summary>
        /// 数据输出进度显示
        /// </summary>
        private void progress_event(object data)
        {
            while (pe_on)
            {
                if (sub_on)//&& _count > 0 && _index > -1)
                {
                    ExportProgressArgs e = new ExportProgressArgs();
                    e.Index = _index;
                    e.Count = _count;
                    e.StepIndex = _stepindex;
                    e.Steps = _stepcount;

                    set_pe(e);

                    if (((_isBatchExport && e.IsBatchCompleted) //批量导出模式
                            ||
                               !_isBatchExport)    //非批量,单数据集模式
                            && (_index >= _count))
                    {
                        sub_on = false;
                        if (ExportProgressCompleted != null)
                        {
                            ExportProgressCompletedArgs ec = new ExportProgressCompletedArgs(true);
                            ExportProgressCompleted.Invoke(this, ec);
                        }
                    }

                    Thread.Sleep(1000);
                }
                else
                {
                    System.Threading.Thread.Sleep(100);
                }
            }
        }