public override void DashboardTimerElapsed(object sender, ElapsedEventArgs e) { Debug.Print("Refresh timer is working. Interval: " + this.DashboardTimer.Interval / 1000 + "s."); if (IsTimerEnabled) { TabFormControl.BeginInvoke(new Action(() => { if (TabFormControl.SelectedPage != null) { foreach (Control c in TabFormControl.SelectedPage.ContentContainer.Controls) { if (c is DevExpress.DashboardWin.DashboardViewer) { _viewer = (c as DevExpress.DashboardWin.DashboardViewer); } } _viewer.ReloadData(true); Debug.Print(" Dashboard refreshed: " + _viewer.DashboardSource); } else { TimerStop(); } })); } }
public override void DashboardTimerElapsed(object sender, ElapsedEventArgs e) { Debug.Print("Rotate timer is working. Interval: " + this.DashboardTimer.Interval / 1000 + "s"); if (IsTimerEnabled) { var index = 0; var pageIndex = TabFormControl.Pages.IndexOf(TabFormControl.SelectedPage); var maxIndex = TabFormControl.Pages.Count - 1; if (maxIndex > 0) { if (pageIndex == maxIndex) { index = 0; } else { index += 1; } } else { index = 0; } TabFormControl.BeginInvoke(new Action(() => { if (TabFormControl.Pages.Count > 0) { TabFormControl.SelectedPage = TabFormControl.Pages[index]; } else { TimerStop(); } })); } }