private void okBtn_Click(object sender, EventArgs e) { string errorList = ""; if (projectLocTxt.Text.Trim().Length < 1) { errorList += "- Project Path Empty\n"; } else if (!Directory.Exists(projectLocTxt.Text)) { errorList += "- Project Path Doesn't Exist\n"; } if (buildLocTxt.Text.Trim().Length < 1) { errorList += "- Build Path Empty\n"; } else if (!Directory.Exists(Path.GetDirectoryName(buildLocTxt.Text))) { errorList += "- Build Path Doesn't Exist\n"; } if (errorList.Length > 1) { MetroMessageBox.Show(this, errorList, "You Recieved The Following Errors"); } else { target = getTargetFromIndex(buildTargetCb.SelectedIndex); projectPath = projectLocTxt.Text; buildPath = buildLocTxt.Text; this.DialogResult = System.Windows.Forms.DialogResult.OK; } }
public InputBox(Form1.BuildTarget origTarget = Form1.BuildTarget.None, string origProjectPath = null, string origBuildPath = null) { InitializeComponent(); target = origTarget; projectPath = origProjectPath; buildPath = origBuildPath; }