public MainWindow() { InitializeComponent(); string message = "Get Ready..."; _time = TimeSpan.FromSeconds(10); sw = new Stopwatch(); _timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate { tbTime.Text = message + _time.Seconds.ToString(); if (_time == TimeSpan.Zero) { _timer.Stop(); message = null; if (!bFlag) { tbTime.Text = "GO!"; sw.Start(); // exam duration 15 sec _time = TimeSpan.FromSeconds(15); _timer.Start(); } else { sw.Stop(); tbTime.Text = String.Format("Completed (captured {0} events)!", CurrentExamData.Data.Count); // Save data to file CurrentExamData.spillData(); // display graph new ResultWindow(CurrentExamData).Show(); this.Close(); } bFlag = !bFlag; } _time = _time.Add(TimeSpan.FromSeconds(-1)); }, Application.Current.Dispatcher); _timer.Start(); drawnSkeletons = new Dictionary <int, SkeletonDrawing>(); CurrentExamData = new ExamData(); KinectSensorChooser.KinectSensorChanged += new DependencyPropertyChangedEventHandler(KinectSensorChooser_KinectSensorChanged); }
public ResultWindow(ExamData _data) : this() { this.examData = _data; showColumnChart(); }