예제 #1
0
 public void RaiseItemExportedException(ImportItem item, Exception ee)
 {
     if (this.ItemExportException != null)
     {
         Application.Current.Dispatcher.BeginInvoke(new Action(() =>
         {
             this.ItemExportException.Invoke(item, ee);
         }));
     }
 }
예제 #2
0
 private void ExportItem(ImportItem item)
 {
     try
     {
         this.RegisterExportItem(item);
         this.TheManager.SyncExportItem(item);
         this.UnRegisterExportItem(item);
     }
     catch (Exception ee)
     {
         Trace.WriteLine("### Exception [" + ee.Message + "]; Source = " + ee.Source);
         Trace.WriteLine("###" + ee.StackTrace);
         this.ShowErrorInfo("Exception : " + ee.Message);
         this.Log.E(this, ee);
     }
 }
예제 #3
0
 public void RaiseItemExportedEvent(ImportItem item)
 {
     if (this.ItemExportedEvent != null)
         this.ItemExportedEvent.Invoke(this, item);
 }
예제 #4
0
        /// <summary>
        /// 在当前线程中直接进行数据采集操作。
        /// </summary>
        public void SyncExportItem(ImportItem item)
        {
            item.ImportState = EImportStatus.Importing;
            item.SyncImportState2Remote();

            item.WriteLine("Start to Export");

            this.RaiseItemExportingEvent(item);
            item.DoExport();
            this.RaiseItemExportedEvent(item);

            if (item.ImportState == EImportStatus.Interrupt)
            {
                item.WriteLine("Export Interrupt;");
            }
            else if (item.ImportState == EImportStatus.Importing)
            {
                item.ImportState = EImportStatus.Imported;
                item.WriteLine("Export over;");
            }

            item.WriteLine("TotalCount = " + item.TotalCount);
            item.WriteLine("ValidCount = " + item.ValidIndex);

            item.SyncImportState2Remote();
        }
예제 #5
0
 /// <summary>
 /// 开启子线程,进行数据的采集操作。
 /// </summary>
 public void AsyncExportItem(ImportItem item)
 {
     new Thread(new ParameterizedThreadStart(this.OnImportThreadStart)).Start(item);
 }
예제 #6
0
 public void SyncExportItem(DateTime targetDate, ImportItem item)
 {
     this.TargetDate = targetDate;
     this.SyncExportItem(item);
 }
예제 #7
0
        private void RegisterExportItem(ImportItem item)
        {
            if (item == null)
                return;

            item.PropertyChanged += OnExportItemPropertyChanged;
        }
예제 #8
0
 /// <summary>
 /// 结束进度条。
 /// </summary>
 private void OnItemEndExporting(object sender, ImportItem item)
 {
     if (this.PBBar != null)
         this.PBBar.Close();
 }
예제 #9
0
        /// <summary>
        /// 显示进度条。
        /// </summary>
        private void OnItemStartExporting(object sender, ImportItem item)
        {
            if (this.PBBar == null)
            {
                this.PBBar = new MyProgressBar();
            }

            this.PBBar.Show(item.TotalCount);
        }