Exemple #1
0
        /// <summary>
        /// Occurs each time split gets completed.  Allows for UI update by marshalling the call accordingly.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LapCompletedEventHandler(object sender, LapsManager.LapEventArgs e)
        {
            if (!m_dispatcher.CheckAccess()) // are we currently on the UI thread?
            {
                // We're not in the UI thread, ask the dispatcher to call this same method in the UI thread, then exit
                m_dispatcher.BeginInvoke(new LapCompletedEventHandlerDelegate(LapCompletedEventHandler), new object[] { sender, e });
                return;
            }

            var form = new EventCompletion();

            form.InitLapEventCompletion(new LapViewControl.LapDetailItem(e.LapNumber, e.LapTime, e.LapDistanceKm, e.LapAvgWatts, e.TotalTime));

            DialogResult result = form.ShowDialog(this);
        }
Exemple #2
0
        /// <summary>
        /// Occurs each time split gets completed.  Allows for UI update by marshalling the call accordingly.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SplitCompletedEventHandler(object sender, SplitsManager.SplitEventArgs e)
        {
            if (!m_dispatcher.CheckAccess()) // are we currently on the UI thread?
            {
                // We're not in the UI thread, ask the dispatcher to call this same method in the UI thread, then exit
                m_dispatcher.BeginInvoke(new SplitCompletedEventHandlerDelegate(SplitCompletedEventHandler), new object[] { sender, e });
                return;
            }

            //if (!this.IsControlAtFront(SplitsView))
            //{
            //    tsbSplits.PerformClick();
            //    m_splitsViewDisplayTime = DateTime.Now;
            //}

            var form = new EventCompletion();

            form.InitSplitEventCompletion(new SplitsViewControl.SplitItem(e.SplitNumber, e.SplitTimeStr, e.SplitSpeedStr, e.TotalDistanceStr, e.TotalTimeStr, e.DeltaTimeStr, e.SplitsInKm, e.AheadOfGoalTime));

            DialogResult result = form.ShowDialog(this);


            //Logger.LogInformation($"SplitGoalCompletedEventHandler {e.SplitNumberStr}, {e.SplitTimeStr}, {e.SplitSpeedStr}, {e.TotalDistanceStr}, {e.TotalTimeStr}");
        }