示例#1
0
        private bool Save()
        {
            TemplateOutputMode mode = (singleFileRadioButton.Checked ? TemplateOutputMode.SingleFile : TemplateOutputMode.MultipleFile);
            string             singleFileOutputPath = (mode == TemplateOutputMode.SingleFile ? singleFileOutputPathTextBox.Text : null);

            if (string.IsNullOrEmpty(xsltPathTextBox.Text))
            {
                MessageBox.Show("You must enter the XSLT Path.");
                return(false);
            }

            if (mode == TemplateOutputMode.SingleFile && string.IsNullOrEmpty(singleFileOutputPathTextBox.Text))
            {
                MessageBox.Show("You must enter the Output Path.");
                return(false);
            }

            if (this.Template == null)
            {
                this.Template = new Template(this.Project, xsltPathTextBox.Text, mode, singleFileOutputPath, this.TemplateOutputDefinitions)
                {
                    GenerateByDefault = generateByDefaultCheckBox.Checked
                };
            }
            else
            {
                this.Template.XsltAbsolutePath          = xsltPathTextBox.Text;
                this.Template.OutputMode                = mode;
                this.Template.OutputAbsolutePath        = singleFileOutputPath;
                this.Template.TemplateOutputDefinitions = this.TemplateOutputDefinitions;
                this.Template.GenerateByDefault         = generateByDefaultCheckBox.Checked;
            }

            return(true);
        }
示例#2
0
        public Template(Project project, string xsltAbsolutePath, TemplateOutputMode outputMode, string outputAbsolutePath, List <TemplateOutputDefinition> outputDefinitions)
            : this()
        {
            _project = project;

            this.XsltAbsolutePath          = xsltAbsolutePath;
            this.OutputMode                = outputMode;
            this.OutputAbsolutePath        = outputAbsolutePath;
            this.TemplateOutputDefinitions = outputDefinitions;
        }