Example #1
0
 public TaskInfoViewItem(TaskInfo task)
   : base(new string[6], 0)
 {
   this.task = task;
   this.SubItems[0].Text = task.File.Name;
   this.SubItems[1].Text = task.File.Length.ToString("n0");
   this.ToolTipText = task.File.FullName;
 }
Example #2
0
    private void worker_DoWork(object sender, DoWorkEventArgs e)
    {
      foreach (TaskInfo taskInfo in this.tasks)
      {
        TapeFile tapeFile = new TapeFile(taskInfo.File.FullName);
        this.currentTask = taskInfo;
        this.currentTape = tapeFile;
        PlaybackOptions playbackOptions = new PlaybackOptions();
				playbackOptions.Symbols = new List<string>((IEnumerable<string>) this.instruments.Keys).ToArray();
				playbackOptions.Trades = this.settings.Trades;
				playbackOptions.Quotes = this.settings.Quotes;
				playbackOptions.BeginTime = this.settings.From;
				playbackOptions.EndTime = this.settings.To;
        this.OnCurrentTaskBegin();
        if (this.worker.CancellationPending)
        {
          e.Cancel = true;
          this.OnCurrentTaskDone((Exception) null);
        }
        else
        {
          Exception error = (Exception) null;
          try
          {
            this.currentSkipped = false;
            this.currentWriter = !this.settings.Advanced.WriteDataAsync ? (DataWriter) new SyncDataWriter() : (DataWriter) new AsyncDataWriter(this.settings.Advanced.MaxBufferSize);
            this.currentWriter.BeginWrite();
            tapeFile.Play((IMessageReceiver) this, playbackOptions);
          }
          catch (Exception ex)
          {
            error = ex;
          }
          finally
          {
            try
            {
              this.currentWriter.EndWrite();
            }
            catch (Exception ex)
            {
              error = ex;
            }
            this.OnCurrentTaskDone(error);
          }
        }
      }
    }