Esempio n. 1
0
 /// <summary>
 ///     Joins the spreadsheet that is selected
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Join_Click(object sender, EventArgs e)
 {
     Hide();
     _form = new SpreadsheetForm(_clientController, SpreadsheetName.Text);
     _form.ShowDialog();
     Close();
 }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
 /// <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); }));
 }