Exemple #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     windowChat = (WindowChat)this.Owner;
     mainWindow = (MainWindow)this.Owner.Owner;
     currentConversation = windowChat.currentConversations.Last().Key;
     this.Title += currentConversation;
 }
Exemple #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     windowChat          = (WindowChat)this.Owner;
     mainWindow          = (MainWindow)this.Owner.Owner;
     currentConversation = windowChat.currentConversations.Last().Key;
     this.Title         += currentConversation;
 }
Exemple #3
0
        private void buttonSignIn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (this.Connect() == false)
                {
                    throw new ConnectingException();
                }

                if (proxy.SignIn(textBoxUsername.Text, textBoxPassword.Text) == false)
                {
                    throw new UsernamePasswordMismatchException();
                }

                username = textBoxUsername.Text;

                var windowChat = new WindowChat();
                windowChat.Owner = this;
                windowChat.Show();

                this.Hide();
            }

            catch (ConnectingException)
            {
            }

            catch (UsernamePasswordMismatchException)
            {
                MessageBox.Show("Username and password mismatch or the contact doesn't exist or you have already entered", "Error!");
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!");
            }
        }
Exemple #4
0
        private void buttonSignIn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (this.Connect() == false)
                {
                    throw new ConnectingException();
                }

                if (proxy.SignIn(textBoxUsername.Text, textBoxPassword.Text) == false)
                {
                    throw new UsernamePasswordMismatchException();
                }

                username = textBoxUsername.Text;

                var windowChat = new WindowChat();
                windowChat.Owner = this;
                windowChat.Show();

                this.Hide();
            }

            catch (ConnectingException)
            {
            }

            catch (UsernamePasswordMismatchException)
            {
                MessageBox.Show("Username and password mismatch or the contact doesn't exist or you have already entered", "Error!");
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!");
            }
        }