/// <summary> /// The constructor for the MainWindow of the client. /// This window has the following things implemented: /// - Connection to the server /// - Login connection fail /// - TextEditor updater /// - Chatbox updater /// - Saving and opening file /// - The logger /// - Credits box /// </summary> public MainWindow() { _client = new Net.Client("127.0.0.1", 1337, OnLogin, AddMessageToLog, UpdateTextEditor, RecoverUpdateTextEditor, OnLoginFailed); _login = new LoginWindow(_client, this); _login.Show(); this.Hide(); InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; _previousEditorContent = TextEditor.Text; Timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1000) }; Timer.Tick += Timer_Tick; }
/// <summary> /// Logic for the Loginwindow. /// The main purpose for this winows is to handle the login for a client into a session. /// </summary> /// <param name="client"></param> /// <param name="main"></param> public LoginWindow(Net.Client client, MainWindow main) { _client = client; InitializeComponent(); // Closing += LoginWindow_Closing; }