/// <summary> /// Handles the Click event of the btnTest control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> void btnTest_Click(object sender, EventArgs e) { var type = (FileUploaderType)cmbType.SelectedItem; var host = txtHost.Text; var user = txtUser.Text; var pass = txtPassword.Text; IFileUploader server; try { server = ServerInfoBase.CreateFileUploader(type, host, user, pass); } catch (Exception ex) { const string errmsg = "Failed to create the IFileUploader to use for testing the connection due to an unexpected error:{0}{1}"; MessageBox.Show(string.Format(errmsg, Environment.NewLine, ex), "Error", MessageBoxButtons.OK); return; } var testForm = new TestServerSettingsForm(server); btnTest.Enabled = false; testForm.FormClosing += delegate { btnTest.Invoke((Action)(() => btnTest.Enabled = true)); }; testForm.StartTesting(); }
/// <summary> /// Handles the ServerChanged event of a <see cref="MasterServerInfo"/> instance. /// </summary> /// <param name="sender">The source of the event.</param> void MasterServerInfo_ServerChanged(ServerInfoBase sender) { try { // Refresh the display of the item in the ListBox lstMS.Invoke((Action)(() => lstMS.RefreshItem(sender))); } catch (Exception ex) { Debug.Fail(ex.ToString()); } }
/// <summary> /// Initializes a new instance of the <see cref="ModifyServerForm"/> class. /// </summary> /// <param name="server">The server being modified.</param> public ModifyServerForm(ServerInfoBase server) { _server = server; InitializeComponent(); }