private void SendMessage() { ClientLogic logic = new ClientLogic(); logic.SendMessage(MessageBox.Text, UserName); // Clears the message box. MessageBox.Text = ""; }
public ChatWindow() { InitializeComponent(); //refreshs the history box ClientLogic logic = new ClientLogic(historyBox); Application.Current.MainWindow = this; Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; historyBox.IsReadOnly = true; }
private void UnLoggin_click(object sender, RoutedEventArgs e) { ClientLogic logic = new ClientLogic(); if (!MainWindow.IsOpened) { logic.UnLoggin(); logic.CloseConnection(); MainWindow mainWindow = new MainWindow(); mainWindow.Show(); ChatWindow.IsOpened = false; MainWindow.IsOpened = true; this.Close(); } }
public MainWindow() { InitializeComponent(); //creates connection and opens proxy to use try { ClientLogic logic = new ClientLogic(); logic.CreateConnection(); logic.OpenProxy(); UpdateConnectionsCounter(); UpdateConnectionState(); } catch (Exception ex) { MessageBox.Show(ex.StackTrace); MessageBox.Show(ex.Message); } //The current login window is the main window now. Application.Current.MainWindow = this; Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; }
private void UpdateConnectionState() { ClientLogic logic = new ClientLogic(); ConnectionStateLabel.Content = logic.GetConnetionState(); }
private void UpdateConnectionsCounter() { ClientLogic logic = new ClientLogic(); ConnectionCounterLabel.Content = $"{logic.GetConnectionsCounter()} / {logic.GetMaxConnetionsNumber()}"; }