public EditTemplateOutputDefinition(TemplateOutputDefinition templateOutputDefinition)
        {
            InitializeComponent();

            this.ProjectDocument = ProjectContext.Project.GetXDocument(out this.NamespaceManager);
            this.Template = templateOutputDefinition.Template;
            this.TemplateOutputDefinition = templateOutputDefinition;
        }
Esempio n. 2
0
 public List <TemplateOutputDefinitionFilenameResult> Compute(TemplateOutputDefinition templateOutputDefinition)
 {
     return(Compute(templateOutputDefinition.ContainingProject, templateOutputDefinition.ElementType, templateOutputDefinition.FilterXPath, templateOutputDefinition.RootAbsolutePath));
 }
        private void okButton_Click(object sender, EventArgs e)
        {
            if (elementTypeComboBox.SelectedIndex < 0)
            {
                MessageBox.Show("Please select an Element Type.");
                return;
            }

            if (rootPathTextBox.Text.IsNullOrEmpty())
            {
                MessageBox.Show("Please enter or choose the Root Path.");
                return;
            }

            if (filenameXPathTextBox.Text.IsNullOrEmpty())
            {
                MessageBox.Show("Please enter the Filename XPath.");
                return;
            }

            ElementType elementType = ((EnumValue<ElementType>)elementTypeComboBox.SelectedItem).Value;

            if (this.TemplateOutputDefinition == null)
                this.TemplateOutputDefinition = new TemplateOutputDefinition(this.Template, elementType, filterXPathTextBox.Text, rootPathTextBox.Text, filenameXPathTextBox.Text);
            else
            {
                this.TemplateOutputDefinition.ElementType = elementType;
                this.TemplateOutputDefinition.FilterXPath = filterXPathTextBox.Text;
                this.TemplateOutputDefinition.RootAbsolutePath = rootPathTextBox.Text;
                this.TemplateOutputDefinition.FilenameXPath = filenameXPathTextBox.Text;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }