nature_net.user_controls.pin_box.UpdateFocus C# (CSharp) Метод

UpdateFocus() публичный Метод

public UpdateFocus ( bool forward, bool type, string n ) : void
forward bool
type bool
n string
Результат void
        public void UpdateFocus(bool forward, bool type, string n)
        {
            int a = num_digits + 1;
            //if (forward) a = a + 1;
            //if (a == 0)
            //{
            //    digit1.Focus();
            //    digit1.SelectAll();
            //    if (!forward && type) digit1.Text = "";
            //}
            if (a == 1)
            {
                digit1.Focus();
                digit1.SelectAll();
                if (!forward && type) digit1.Text = "";
            }
            if (a == 2)
            {
                digit2.Focus();
                digit2.SelectAll();
                if (type && forward) digit1.Text = n;
                if (!forward && type) digit2.Text = "";
            }
            if (a == 3)
            {
                digit3.Focus();
                digit3.SelectAll();
                if (type && forward) digit2.Text = n;
                if (!forward && type) digit3.Text = "";
            }
            if (a == 4)
            {
                digit4.Focus();
                digit4.SelectAll();
                if (type && forward) digit3.Text = n;
                if (!forward && type) digit4.Text = "";
            }
            if (a == 5 && type && forward)
            {
                digit4.Text = n;
                if (auto_submit) this.submit();
            }
        }