void controller_CurrentTimeUpdate(object sender, EventArgs e) { TimelineBaseData timeline = controller.Timeline; if (timeline == null) { return; } if (InvokeRequired) { Invoke(new Action(() => { controller_CurrentTimeUpdate(sender, e); })); return; } else { // play pending alerts var pendingAlerts = timeline.PendingAlertsAt(controller.CurrentTime, AppConst.TooOldThreshold); foreach (var pendingAlert in pendingAlerts) { pendingAlert.Processed = soundPlayProcess.PlayAlert(pendingAlert, this.PlaySoundByACT); } // sync dataGridView dataGridView.DataSource = null; dataGridView.DataSource = timeline.VisibleItemsAt(controller.CurrentTime - TimeLeftCell.THRESHOLD, numberOfRowsToDisplay).ToList(); } }
private void Controller_TimelineUpdate(object sender, EventArgs e) { TimelineBaseData timeline = timelineCore.Controller.Timeline; if (timeline == null) { return; } double endtime = timeline.EndTime; labelEndPos.Text = FormatMMSS(endtime); trackBar.Maximum = (int)Math.Ceiling(endtime); labelLoadedTimeline.Text = timeline.Name; }