示例#1
0
 private void UpdateTaskState(ExportTask task)
 {
     this.Invoke((Action)(() =>
     {
         ExportTaskViewItem local_0 = this.taskItems[task];
         local_0.UpdateState();
         local_0.EnsureVisible();
     }));
 }
示例#2
0
        public void Init(IDataSeries[] seriesList)
        {
            this.ltvExportTasks.BeginUpdate();
            this.ltvExportTasks.Items.Clear();
            foreach (IDataSeries dataSeries in seriesList)
            {
                string str = DataSeriesHelper.GetDataSeriesInfo(dataSeries.Name).Symbol;
                foreach (char oldChar in Path.GetInvalidFileNameChars())
                {
                    str = str.Replace(oldChar, '_');
                }
                string             outputFileName     = string.Format("{0}.{1}.csv", (object)str, (object)DataSeriesHelper.SeriesNameToString(dataSeries.Name));
                ExportTask         exportTask         = new ExportTask(dataSeries, outputFileName);
                ExportTaskViewItem exportTaskViewItem = new ExportTaskViewItem(exportTask);
                this.taskItems.Add(exportTask, exportTaskViewItem);
                this.ltvExportTasks.Items.Add((ListViewItem)exportTaskViewItem);
            }
            this.ltvExportTasks.EndUpdate();
            this.lblCurrentProgress.Text = "";
            this.pgbTotal.Maximum        = seriesList.Length;
            List <DateTime> list = new List <DateTime>();

            foreach (IDataSeries idataSeries in seriesList)
            {
                if (idataSeries.Count > 0)
                {
                    list.Add(idataSeries.FirstDateTime);
                    list.Add(idataSeries.LastDateTime);
                }
            }
            if (list.Count == 0)
            {
                this.dtpRangeBegin.Value = DateTime.Today;
                this.dtpRangeEnd.Value   = DateTime.Today;
            }
            else
            {
                this.dtpRangeBegin.Value = Enumerable.Min <DateTime>((IEnumerable <DateTime>)list).Date;
                this.dtpRangeEnd.Value   = Enumerable.Max <DateTime>((IEnumerable <DateTime>)list).Date;
            }
            this.OnExportRangeChanged();
        }
示例#3
0
 public void Init(IDataSeries[] seriesList)
 {
   this.ltvExportTasks.BeginUpdate();
   this.ltvExportTasks.Items.Clear();
   foreach (IDataSeries dataSeries in seriesList)
   {
     string str = DataSeriesHelper.GetDataSeriesInfo(dataSeries.Name).Symbol;
     foreach (char oldChar in Path.GetInvalidFileNameChars())
       str = str.Replace(oldChar, '_');
     string outputFileName = string.Format("{0}.{1}.csv", (object) str, (object) DataSeriesHelper.SeriesNameToString(dataSeries.Name));
     ExportTask exportTask = new ExportTask(dataSeries, outputFileName);
     ExportTaskViewItem exportTaskViewItem = new ExportTaskViewItem(exportTask);
     this.taskItems.Add(exportTask, exportTaskViewItem);
     this.ltvExportTasks.Items.Add((ListViewItem) exportTaskViewItem);
   }
   this.ltvExportTasks.EndUpdate();
   this.lblCurrentProgress.Text = "";
   this.pgbTotal.Maximum = seriesList.Length;
   List<DateTime> list = new List<DateTime>();
   foreach (IDataSeries idataSeries in seriesList)
   {
     if (idataSeries.Count > 0)
     {
       list.Add(idataSeries.FirstDateTime);
       list.Add(idataSeries.LastDateTime);
     }
   }
   if (list.Count == 0)
   {
     this.dtpRangeBegin.Value = DateTime.Today;
     this.dtpRangeEnd.Value = DateTime.Today;
   }
   else
   {
     this.dtpRangeBegin.Value = Enumerable.Min<DateTime>((IEnumerable<DateTime>) list).Date;
     this.dtpRangeEnd.Value = Enumerable.Max<DateTime>((IEnumerable<DateTime>) list).Date;
   }
   this.OnExportRangeChanged();
 }