Esempio n. 1
0
        private void Serv_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                string msg = null;

                if (e.Error != null)
                {
                    msg = e.Error.Message;
                }
                else if (e.Result == false)
                {
                    msg = "Username or Password Already in Use";
                }
                else if (e.Cancelled)
                {
                    msg = "Didn't work!";
                }
                else
                {
                    await Navigation.PushModalAsync(new Login());
                }
                InsertStatus.Text = msg;
            });
        }
        void Service_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
        {
            switch (e.Result)
            {
            case RegisterResponse.Ok:
                MessageBox.Show("You are now registered.");
                break;

            case RegisterResponse.AlreadyRegistered:
                MessageBox.Show("You are already registered");
                break;

            case RegisterResponse.IsSmurf:
                MessageBox.Show("You have already registered with a different account.");
                break;

            case RegisterResponse.NotValidSpringLogin:
                MessageBox.Show("You need to register with your Spring account.");
                break;

            case RegisterResponse.NotValidSpringPassword:
                MessageBox.Show("Invalid password. You need to use you Spring password.");
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Called when the client successfully registers with the server. Retrieves the ongoing game data.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void proxy_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         state = TicTacToeState.ServiceNotAvailable;
         return;
     }
     if (e.Result)
     {
         try
         {
             proxy.GetGameStateAsync(playerID);
         }
         catch (Exception)
         {
             state = TicTacToeState.ServiceNotAvailable;
         }
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Handler called after registering with the server.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void proxy_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     if (e.Error != null && ServiceError != null)
     {
         // Raise an error notification
         ServiceError(this, new ExceptionEventArgs()
         {
             Error = e.Error
         });
     }
     else if (Registered != null)
     {
         playerID = e.Result;
         // Raise a notification about the registration
         Registered(this, new BooleanEventArgs()
         {
             Answer = e.Result != -1
         });
     }
 }
Esempio n. 5
0
 private void client_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         if (e.Result > 0)
         {
             user.Id = e.Result;
             SaveUserToLocalStorage();
             ShowRejestracja = Visibility.Collapsed;
         }
         else
         {
             ShowRejestracja = Visibility.Visible;
         }
     }
     else
     {
         ShowRejestracja = Visibility.Visible;
     }
     //NotifyPropertyChanged("ShowRejestracja");
 }
 void Service_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     switch (e.Result) {
         case RegisterResponse.Ok:
             MessageBox.Show("You are now registered.");
             break;
         case RegisterResponse.AlreadyRegistered:
             MessageBox.Show("You are already registered");
             break;
         case RegisterResponse.IsSmurf:
             MessageBox.Show("You have already registered with a different account.");
             break;
         case RegisterResponse.NotValidSpringLogin:
             MessageBox.Show("You need to register with your Spring account.");
             break;
         case RegisterResponse.NotValidSpringPassword:
             MessageBox.Show("Invalid password. You need to use you Spring password.");
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
 private void OnEndRegister(object sender, RegisterCompletedEventArgs args)
 {
     if (!ErrorDataModel.Instance.EvalResponse(args)) return;
     //if (!ErrorDataModel.Instance.EvalWebResult(e.Result)) return;
 }
Esempio n. 8
0
 void client_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     MessageBox.Show(e.Result);
 }
Esempio n. 9
0
 void client_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     MessageBox.Show(e.Result);
 }
Esempio n. 10
0
        void registerClient_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                File.AppendAllText("c:/user_" + e.Result.id + ".txt","账号:" + e.Result.id );
                File.AppendAllText("c:/user_" + e.Result.id + ".txt","密码:" + txtPwd.Password );
                MessageBox.Show("成功注册,用户信息保存在c:/user_" + e.Result.id + ".txt");

                this.Close();
            }
            else
            {
                MessageBox.Show("注册失败");
                txtNickName.IsEnabled = true;
                txtPwd.IsEnabled = true;
                txtRepeatPwd.IsEnabled = true;
                cmboSex.IsEnabled = true;
                cmboDay.IsEnabled = true;
                cmboMonth.IsEnabled = true;
                cmboYear.IsEnabled = true;
            }

        }
Esempio n. 11
0
        void ds_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
        {
            spinnerrr.Visibility = Visibility.Hidden;
            if (e.Result.RegisterResult != null)
            {
                lblRegisterStatus.Content = String.Format("Registering \"{0}\" succeeded!", txtName.Text);
                if (Properties.Settings.Default.Credentials == null)
                {
                    Properties.Settings.Default.Credentials = new XmlUserCredentials();
                }
                Properties.Settings.Default.Credentials.Name = txtName.Text;
                Properties.Settings.Default.Credentials.Password = pwdConfirmPassword.Text;
                Properties.Settings.Default.Save();

                string nextMessage = String.Format("{0} saved in settings as default player.", txtName.Text);
            }
            else
            {
                lblRegisterStatus.Content = "Registering failed.";
            }
        }
        private void OnEndRegister(object sender, RegisterCompletedEventArgs args)
        {
            if (args.Error == null)
            {

            }
        }
 void _accountService_RegisterCompleted(object sender, RegisterCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         _locator.LoggerViewModel.AddLog("Add new user:"******"";
         NewUser.password = "";
         NewUser.email   = "";
         RaisePropertyChange("NewUser");
         RefresUsersBody();
     }
 }
Esempio n. 14
0
 public void InvokeRegisterCompleted(RegisterCompletedEventArgs e)
 {
     EventHandler<RegisterCompletedEventArgs> handler = RegisterCompleted;
     if (handler != null) handler(this, e);
 }
 private void OnEndRegister(object sender, RegisterCompletedEventArgs args)
 {
     if (args.Error == null)
     {
         if (args.Result.ErrorCode == WebResult.ErrorCodeList.SUCCESS)
         {
             accountService.LoginAsync(Username, Password);
         }
         ErrorCode = args.Result.ErrorCode;
     }
 }