Пример #1
0
#pragma warning restore 0649

        public void Initialize()
        {
            maleCheckbox.AddOnSetCheckedListener((value) =>
            {
                if (value)
                {
                    femaleCheckbox.SetChecked(false);
                }
            });

            femaleCheckbox.AddOnSetCheckedListener((value) =>
            {
                if (value)
                {
                    maleCheckbox.SetChecked(false);
                }
            });

            registerButton.AddOnClickListener(() =>
            {
                if (string.IsNullOrEmpty(loginTextField.Text))
                {
                    logger.Warning("You must provide login.");

                    return;
                }

                if (string.IsNullOrEmpty(passwordTextField.Text))
                {
                    logger.Warning("You must provide password.");

                    return;
                }

                if (!passwordTextField.Equals(repeatPasswordTextField.Text))
                {
                    logger.Warning("Passwords must match.");

                    return;
                }

                Account account = new Account()
                {
                    Login    = loginTextField.Text,
                    Password = passwordTextField.Text
                };

                logger.Info($"Successfully registered with " +
                            $"login \"{ account.Login }\" and password \"{ account.Password }\".");
            });
        }