private void Ok_Click(object sender, EventArgs e)
{
if (!IsURLValid())
{
MessageBox.Show("Your Server Density URL is incorrect. It needs to be in the form http://example.serverdensity.com or http://example.serverdensity.io (or using https).", "Invalid URL", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!IsAgentKeyValid())
{
MessageBox.Show("Your agent key is incorrect. It needs to contain alphanumeric characters and no spaces.", "Invalid agent key", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!IsPluginDirectoryValid())
{
MessageBox.Show("Your plugin directory is not valid. It is either blank or doesn't exist.", "Invalid plugin directory", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!IsConnectionStringValid())
{
MessageBox.Show("Your MongoDB connection string is not valid.", "Invalid connection string", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
Save();
Hide();
}