Repository: dotnet/runtime
File: src/libraries/System.ComponentModel.TypeConverter/src/System/Timers/Timer.cs (C#)

Code before:
        /// </summary>
        /// <param name="interval">
        /// The time between events. The value in milliseconds must be greater than zero and less than or equal to <see cref="int.MaxValue"/>.
        /// </param>
        public Timer(TimeSpan interval) : this(interval.TotalMilliseconds)
        {
        }

        /// <summary>
        /// Gets or sets a value indicating whether the Timer raises the Tick event each time the specified
        /// Interval has elapsed, when Enabled is set to true.
        /// </summary>
        [TimersDescription(TimersDescriptionStringId.TimerAutoReset), DefaultValue(true)]
        public bool AutoReset
        {
            get => _autoReset;
            set
            {
                if (DesignMode)
                {
                    _autoReset = value;
                }
                else if (_autoReset != value)
                {
                    _autoReset = value;
                    if (_timer != null && _enabled)
                    {
                        UpdateTimer();
                    }
                }
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the <see cref='System.Timers.Timer'/>
        /// is able to raise events at a defined interval.
        /// The default value by design is false, don't change it.
        /// </summary>
        [TimersDescription(TimersDescriptionStringId.TimerEnabled), DefaultValue(false)]
        public bool Enabled
        {
            get => _enabled;
            set
            {
                if (DesignMode)
                {
                    _delayedEnable = value;
                    _enabled = value;
                }
                else if (_initializing)
                {

Review comment (suggestion):
@copilot, I think it'd be better to move these checks into UpdateTimer itself; that way all callers of UpdateTimer get the right behavior.

Code after:
        /// </summary>
        /// <param name="interval">
        /// The time between events. The value in milliseconds must be greater than zero and less than or equal to <see cref="int.MaxValue"/>.
        /// </param>
        public Timer(TimeSpan interval) : this(interval.TotalMilliseconds)
        {
        }

        /// <summary>
        /// Gets or sets a value indicating whether the Timer raises the Tick event each time the specified
        /// Interval has elapsed, when Enabled is set to true.
        /// </summary>
        [TimersDescription(TimersDescriptionStringId.TimerAutoReset), DefaultValue(true)]
        public bool AutoReset
        {
            get => _autoReset;
            set
            {
                if (DesignMode)
                {
                    _autoReset = value;
                }
                else if (_autoReset != value)
                {
                    _autoReset = value;
                    UpdateTimer();
                }
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the <see cref='System.Timers.Timer'/>
        /// is able to raise events at a defined interval.
        /// The default value by design is false, don't change it.
        /// </summary>
        [TimersDescription(TimersDescriptionStringId.TimerEnabled), DefaultValue(false)]
        public bool Enabled
        {
            get => _enabled;
            set
            {
                if (DesignMode)
                {
                    _delayedEnable = value;
                    _enabled = value;
                }
                else if (_initializing)
                {
                    _delayedEnable = value;
                }
                else if (_enabled != value)