예제 #1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            //check if input fields are empty
            if (String.IsNullOrEmpty(txtFileName.Text.Trim()) || String.IsNullOrEmpty(txtFilePath.Text.Trim()) || String.IsNullOrEmpty(cboExtensions.Text.Trim()))
            {
                MessageBox.Show("All fields are required", "Error");
            }

            else if (chkFileGroup.Checked == true && FileGroup.HasFileGroup(cboExtensions.Text))
            {
                MakeFiles(FileGroup.GetGroup(cboExtensions.Text));
            }

            else
            {
                MakeFiles();
            }
        }
예제 #2
0
        private void chkFileGroup_CheckedChanged(object sender, EventArgs e)
        {
            //skip extension validation for boilerplate, in case the extension is something like CSS (which doesn't have bp, but HTML does)
            //this may need to be expanded on if groups are added that have no boilerplate for any extension
            if (FileGroup.HasFileGroup(cboExtensions.Text) && chkFileGroup.Checked == true)
            {
                ToggleBoilerPlate(true);
            }

            //else, re-validate extension
            else
            {
                ToggleBoilerPlate(Boilerplate.HasBoilerplate(cboExtensions.Text));
            }

            //change text for button + checkbox
            btnGenerate.Text  = chkFileGroup.Checked ? "&Create Files" : "&Create File";
            chkOpenFiles.Text = chkFileGroup.Checked ? "&Open Files When Complete" : "&Open File When Complete";
        }
예제 #3
0
 //checks user input; enables boilerplate checkbox where supported
 private void cboExtensions_TextUpdate(object sender, EventArgs e)
 {
     ToggleBoilerPlate(Boilerplate.HasBoilerplate(cboExtensions.Text));
     ToggleFileGroup(FileGroup.HasFileGroup(cboExtensions.Text));
 }