示例#1
0
 public static ClientConnection GetConnection(string login, string password)
 {
     try
     {
         connection = ClientConnection.GetInstance(login, password);
     }
     catch (Exception e)
     {
         return(null);
     }
     return(connection);
 }
示例#2
0
 private void RegClickBtn(object sender, RoutedEventArgs e)
 {
     if (LoginBox.Text.Length > 8 && PassBox.Text.Length > 8 && NameBox.Text.Length > 2)
     {
         connection = ClientConnection.GetInstance();
         connection.Connection("#Server: _Registration" + " " + LoginBox.Text + " " + PassBox.Text + " " + NameBox.Text);
         while (true)
         {
             if (ClientConnection.registered == "registered")
             {
                 this.Content = new ChatControl();
                 break;
             }
         }
     }
     else
     {
         MessageBox.Show("Login box lengh should be more than 8 symbols.");
     }
 }
示例#3
0
 public ChatControl()
 {
     connection = ClientConnection.GetInstance();
     InitializeComponent();
     DataContext = new ChatControlViewModel();
 }