Exemplo n.º 1
0
        private void EditProfile()
        {
            User user = this.ChatClient.GetUser();

            if (user != null)
            {
                var profileForm = new ProfileForm(user);
                profileForm.ShowDialog();
                if (profileForm.Result == ProfileForm.Results.Ok)
                {
                    this.UpdateUser(profileForm.User);
                }
            }
        }
Exemplo n.º 2
0
 private void buttonSignIn_Click(object sender, EventArgs e)
 {
     try
     {
         var profileForm = new ProfileForm(new User());
         profileForm.ShowDialog();
         if (profileForm.Result == ProfileForm.Results.Ok)
         {
             if (this.ChatClient.AddUser(profileForm.User))
             {
                 MessageBox.Show("User added, please login.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show("Use different credentials.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     } catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }