/// <summary> /// ButtonConnect click listener: Connects client to Server /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ButtonConnect_Click(object sender, EventArgs e) { string username = Username.Text; if (string.IsNullOrWhiteSpace(username)) { SpreadsheetForm.Warning("Error: Please enter a username", "Empty Username Error", SpreadsheetForm.WarningType.Error); } string address = IpAddress.Text; if (string.IsNullOrWhiteSpace(address)) { SpreadsheetForm.Warning("Error: Please enter an IP Address", "Empty IP Address Error", SpreadsheetForm.WarningType.Error); } _clientController.Connect(username, address); }
/// <summary> /// Creates a warning on Error /// </summary> /// <param name="message">Error message</param> /// <param name="title">Error Name</param> private void Error(string message, string title) { Invoke(new MethodInvoker( () => { SpreadsheetForm.Warning(message, title, SpreadsheetForm.WarningType.Error); })); }