mirror of https://github.com/quasar/Quasar.git
Compacted Builder method
Compacted the validation on frmBuilder's btnBuild_Click(object, EventArgs) method. This is a slight optimization, but it does help remove the repetitive else statements.
This commit is contained in:
parent
d5cb5b9c92
commit
e720d20811
|
@ -202,11 +202,10 @@ namespace xServer.Forms
|
|||
|
||||
private void btnBuild_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txtHost.Text) && !string.IsNullOrEmpty(txtPort.Text) && !string.IsNullOrEmpty(txtDelay.Text) && !string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtMutex.Text))
|
||||
{
|
||||
if (!chkInstall.Checked || (chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text) && !string.IsNullOrEmpty(txtInstallsub.Text)))
|
||||
{
|
||||
if (!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text)))
|
||||
if (!string.IsNullOrEmpty(txtHost.Text) && !string.IsNullOrEmpty(txtPort.Text) && !string.IsNullOrEmpty(txtDelay.Text) && // Connection Information
|
||||
!string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtMutex.Text) && // Client Options
|
||||
!chkInstall.Checked || (chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text) && !string.IsNullOrEmpty(txtInstallsub.Text)) && // Installation Options
|
||||
!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text))) // Persistence and Registry Features
|
||||
{
|
||||
string output = string.Empty;
|
||||
string icon = string.Empty;
|
||||
|
@ -265,12 +264,6 @@ namespace xServer.Forms
|
|||
else
|
||||
MessageBox.Show("Please fill out all required fields!", "Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
else
|
||||
MessageBox.Show("Please fill out all required fields!", "Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
else
|
||||
MessageBox.Show("Please fill out all required fields!", "Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private int GetInstallPath()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue