Esempio n. 1
0
    private void SetupJob()
    {
        _input                = new TextBox();
        _input.Multiline      = true;
        _input.AcceptsReturn  = true;
        _input.AcceptsTab     = true;
        _input.ScrollBars     = System.Windows.Forms.ScrollBars.Both;
        _input.Dock           = DockStyle.Fill;
        _input.SelectionStart = 0; //Work-around for the AppendText bug.
        _input.TextChanged   += new EventHandler(_input_TextChanged);

        _log                = new TextBox();
        _log.Font           = new System.Drawing.Font("Courier New", 8.25f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
        _log.Multiline      = true;
        _log.AcceptsReturn  = true;
        _log.AcceptsTab     = true;
        _log.ScrollBars     = System.Windows.Forms.ScrollBars.Vertical;
        _log.Dock           = DockStyle.Fill;
        _log.SelectionStart = 0; //Work-around for the AppendText bug.
        _log.ReadOnly       = true;

        SetSubItem(Display.name, FileName);
        SetSubItem(Display.dir, DirectoryName);

        _buf              = new Byte[512];
        asyncCallback     = new AsyncCallback(AsyncRead);
        asyncReadCallback = new AsyncReadCallback(InvokedAsyncRead);

        SetStatus(Status.idle);
        timerCallback     = new System.Threading.TimerCallback(TimerTick);
        timerTickCallback = new TimerTickCallback(InvokedTimerTick);
        timer             = new System.Threading.Timer(timerCallback, this, 0, 2000);
    }
Esempio n. 2
0
 public Scheduler(ListView _jobs)
 {
     jobs              = _jobs;
     timerCallback     = new System.Threading.TimerCallback(TimerTick);
     timerTickCallback = new TimerTickCallback(InvokedTimerTick);
     timer             = new System.Threading.Timer(timerCallback, this, 0, 200);
 }
 private void OnTimerTick(object sender, EventArgs eventArgs)
 {
     elapsedTime = (DateTime.Now - timeSpanLog) + aggregateTime;
     TimerTickCallback?.Invoke(elapsedTime);
 }