private void OnNumButtonClick(object sender, EventArgs e)
        {
            if (!enabled || digitsEntered > 3)
            {
                return;
            }

            int num = Array.IndexOf(numButtons, sender);

            if (num < 0)
            {
                return;
            }

            newDuration    = newDuration.AppendDigit(num);
            digitsEntered += 1;
            Rebind();
        }
Exemplo n.º 2
0
        public void InsertText(string text)
        {
            if (text == null)
            {
                throw new ArgumentNullException("text");
            }
            if (digitsEntered > 3)
            {
                return;
            }

            int num;

            if (!Int32.TryParse(text, out num) || num < 0 || num > 9)
            {
                return;
            }

            duration       = duration.AppendDigit(num);
            digitsEntered += 1;
            OnDurationChanged();
        }