Пример #1
0
        private void Btn_Logout_Click(object sender, RoutedEventArgs e)
        {
            WebserviceAPI.Logout();

            LoginUI loginUI = new LoginUI();

            loginUI.Show();
            this.Close();
        }
Пример #2
0
 private void Btn_Save_Click(object sender, RoutedEventArgs e)
 {
     this.Dispatcher.Invoke(new Action(delegate()
     {
         WebserviceAPI.LoggedInUserAccount.FirstName     = FirstNameInput.Text;
         WebserviceAPI.LoggedInUserAccount.LastName      = LastNameInput.Text;
         WebserviceAPI.LoggedInUserAccount.UserName      = UsernameInput.Text;
         WebserviceAPI.LoggedInUserAccount.Password      = PasswordInput.Password;
         WebserviceAPI.LoggedInUserAccount.StatusMessage = StatusMessageInput.Text;
         WebserviceAPI.ChangeUserAccount();
         this.Close();
     }));
 }
Пример #3
0
 private async void Btn_Registration_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         WebserviceAPI.Registrate(FirstNameInput.Text, LastNameInput.Text, UsernameInput.Text, PasswordInput.Password, StatusMessageInput.Text);
         await this.Dispatcher.Invoke(async() =>
         {
             MainChatWindow mainChatWindow = new MainChatWindow();
             mainChatWindow.Show();
             this.Close();
         });
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #4
0
        private async void Btn_Login_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                await WebserviceAPI.LoginAsync(UserNameInput.Text, PasswordInput.Password);

                await this.Dispatcher.Invoke(async() =>
                {
                    MainChatWindow mainChatWindow = new MainChatWindow();
                    mainChatWindow.Show();
                    this.Close();
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #5
0
 private void MainChatWindow_OnClosed(object sender, EventArgs e)
 {
     WebserviceAPI.Logout();
 }
Пример #6
0
 private void LoadChats()
 {
     ChatList = new ObservableCollection <Model.Chat>(WebserviceAPI.LoadChatList());
     ListViewChats.SelectedItem = ChatList.FirstOrDefault();
 }
Пример #7
0
 private void LoadContactList()
 {
     Contacts = new ObservableCollection <UserAccount>(WebserviceAPI.LoadContactList());
 }