Exemplo n.º 1
0
        /// <summary>
        /// Update GUI elements. Needs to be wrapped in:
        /// NSApplication.CheckForIllegalCrossThreadCalls = false/true;
        /// to work properly.
        /// </summary>
        public void updateGUI()
        {
            SetRunner sr     = SetRunner.Instance;
            Set       curSet = sr.CurrentSet;

            if (curSet == null)
            {
                // "blank" values
                lbDistRemain.StringValue = "0x000";
                lbNote.StringValue       = "------------";
                lbStats.StringValue      = "------------";
                lbStroke.StringValue     = "------------";
                lbTimeRemain.StringValue = "--:--";
                return;
            }

            // labels to be updated
            lbNote.StringValue  = curSet.Comment;
            lbStats.StringValue = string.Format("Total Distance Swam: {0}yds{1}Total Time Elapsed: {2}"
                                                , sr.TotalDistanceSwam
                                                , Environment.NewLine
                                                , Set.IntervalToString(sr.TotalTimeElapsed));
            lbStats.SizeToFit();
            lbStroke.StringValue     = curSet.Stroke;
            lbDistRemain.StringValue = string.Format("{0}x{1}"
                                                     , sr.CurrentSet.Number - sr.CurrentNum
                                                     , sr.CurrentSet.Distance);

            updateTBV();
            updateCountDown();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Update countdown clock. Needs to be wrapped in:
 /// NSApplication.CheckForIllegalCrossThreadCalls = false/true;
 /// to work properly.
 /// </summary>
 public void updateCountDown()
 {
     if (m_bCountDescending)
     {
         lbTimeRemain.StringValue = Set.IntervalToString(SetRunner.Instance.CurrentSet.IntervalInt - m_iSec++);
     }
     else
     {
         lbTimeRemain.StringValue = Set.IntervalToString(m_iSec++);
     }
 }