Esempio n. 1
0
 private void joinRequested(Room room)
 {
     processingOverlay.Show();
     roomManager?.JoinRoom(room, r =>
     {
         Push(room);
         processingOverlay.Hide();
     }, _ => processingOverlay.Hide());
 }
Esempio n. 2
0
        private void performRegistration()
        {
            if (focusNextTextbox())
            {
                registerShake.Shake();
                return;
            }

            usernameDescription.ClearErrors();
            emailAddressDescription.ClearErrors();
            passwordDescription.ClearErrors();

            processingOverlay.Show();

            Task.Run(() =>
            {
                bool success;
                RegistrationRequest.RegistrationRequestErrors errors = null;

                try
                {
                    errors  = api.CreateAccount(emailTextBox.Text, usernameTextBox.Text, passwordTextBox.Text);
                    success = errors == null;
                }
                catch (Exception)
                {
                    success = false;
                }

                Schedule(() =>
                {
                    if (!success)
                    {
                        if (errors != null)
                        {
                            usernameDescription.AddErrors(errors.User.Username);
                            emailAddressDescription.AddErrors(errors.User.Email);
                            passwordDescription.AddErrors(errors.User.Password);
                        }
                        else
                        {
                            passwordDescription.AddErrors(new[] { "Something happened... but we're not sure what." });
                        }

                        registerShake.Shake();
                        processingOverlay.Hide();
                        return;
                    }

                    api.Login(emailTextBox.Text, passwordTextBox.Text);
                });
            });
        }
Esempio n. 3
0
            private void apply()
            {
                hideError();

                RoomName.Value     = NameField.Text;
                Availability.Value = AvailabilityPicker.Current.Value;
                Type.Value         = TypePicker.Current.Value;

                if (int.TryParse(MaxParticipantsField.Text, out int max))
                {
                    MaxParticipants.Value = max;
                }
                else
                {
                    MaxParticipants.Value = null;
                }

                Duration.Value = DurationField.Current.Value;

                manager?.CreateRoom(currentRoom.Value, onSuccess, onError);

                processingOverlay.Show();
            }