Esempio n. 1
0
 private void timerRunningDuration_Tick(object sender, EventArgs e)
 {
     if (duration_in_seconds >= 0)
     {
         // Timer is not running
         return;
     }
     const int duration_len = 20;
     StringBuilder sb = new StringBuilder(duration_len);
     KopsikApi.kopsik_format_duration_in_seconds_hhmmss(
         duration_in_seconds, sb, duration_len);
     string s = sb.ToString();
     if (s != linkLabelDuration.Text) {
         linkLabelDuration.Text = s;
     }
 }
        private void timerRunningDuration_Tick(object sender, EventArgs e)
        {
            if (timeEntry.Equals(null) || timeEntry.DurationInSeconds >= 0)
            {
                return;
            }
            if (textBoxDuration.Focused)
            {
                return;
            }
            const int     duration_len = 20;
            StringBuilder sb           = new StringBuilder(duration_len);

            KopsikApi.kopsik_format_duration_in_seconds_hhmmss(
                timeEntry.DurationInSeconds, sb, duration_len);
            string s = sb.ToString();

            if (s != textBoxDuration.Text)
            {
                textBoxDuration.Text = s;
            }
        }