Ejemplo n.º 1
0
        /// <summary>
        /// Creates a log for when a clock has stopped ticking
        /// </summary>
        private void clockStopped_event(object sender, ClockEventArgs e)
        {
            string translatable, logDesc;

            if (e.Speed >= 0)
            {
                translatable = Catalog.GetString("Stopped ticking with {0}.");
            }
            else
            {
                translatable = Catalog.GetString("Stopped counting down with {0}.");
            }

            TimeSpan time = ApplyCap(e.DisplayTime);

            logDesc = string.Format(translatable, TimeFormatSettings.ToString(time));

            Logger.AddEntry(new LogEntry(_name, logDesc, e.Timestamp));
        }
Ejemplo n.º 2
0
        private void RefreshTimeFormatControls()
        {
            supressValidation = true;

            showHoursCheck.Sensitive        = true;
            showMinutesCheck.Sensitive      = true;
            showSecondsCheck.Sensitive      = true;
            showMillisecondsCheck.Sensitive = true;

            if (showHoursCheck.Active)
            {
                if (showMillisecondsCheck.Active)
                {
                    showSecondsCheck.Active    = true;
                    showSecondsCheck.Sensitive = false;
                }

                if (showSecondsCheck.Active)
                {
                    showMinutesCheck.Active    = true;
                    showMinutesCheck.Sensitive = false;
                }

                if (!(showMillisecondsCheck.Active || showSecondsCheck.Active || showMinutesCheck.Active))
                {
                    showHoursCheck.Sensitive = false;
                }
            }
            else if (showMinutesCheck.Active)
            {
                if (showMillisecondsCheck.Active)
                {
                    showSecondsCheck.Active    = true;
                    showSecondsCheck.Sensitive = false;
                }

                if (!(showMillisecondsCheck.Active || showSecondsCheck.Active))
                {
                    showMinutesCheck.Sensitive = false;
                }
            }
            else if (showSecondsCheck.Active && !(showMillisecondsCheck.Active || showMinutesCheck.Active || showHoursCheck.Active))
            {
                showSecondsCheck.Sensitive = false;
            }
            else if (showMillisecondsCheck.Active &&
                     !(showSecondsCheck.Active || showMinutesCheck.Active || showHoursCheck.Active))
            {
                showMillisecondsCheck.Sensitive = false;
            }

            previewDisplaySettings.ShowHours         = showHoursCheck.Active;
            previewDisplaySettings.ShowMinutes       = showMinutesCheck.Active;
            previewDisplaySettings.ShowSeconds       = showSecondsCheck.Active;
            previewDisplaySettings.ShowMilliseconds  = showMillisecondsCheck.Active;
            previewDisplaySettings.ShowLeadingZeroes = showLeadingZerosCheck.Active;
            previewDisplaySettings.ShowMinusSymbol   = showMinusSymbolCheck.Active;
            previewDisplaySettings.ShowPlusSymbol    = showPlusSymbolCheck.Active;
            previewDisplaySettings.ShowSeparators    = showSeparatorsOption.Active;

            previewDisplayBox1.Text = previewDisplaySettings.ToString(previewTimes[0]);
            previewDisplayBox2.Text = previewDisplaySettings.ToString(previewTimes[1]);

            supressValidation = false;
        }