コード例 #1
0
        public EditTemplateOutputDefinition(TemplateOutputDefinition templateOutputDefinition)
        {
            InitializeComponent();

            this.ProjectDocument          = ProjectContext.Project.GetXDocument(out this.NamespaceManager);
            this.Template                 = templateOutputDefinition.Template;
            this.TemplateOutputDefinition = templateOutputDefinition;
        }
コード例 #2
0
        private void EditTemplateOutputDefinition(TemplateOutputDefinition definition)
        {
            if (!Save())
            {
                return;
            }

            using (EditTemplateOutputDefinition dialog = (definition == null ? new EditTemplateOutputDefinition(this.Template) : new EditTemplateOutputDefinition(definition)))
            {
                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (definition == null)
                    {
                        this.TemplateOutputDefinitions.Add(dialog.TemplateOutputDefinition);
                    }

                    BindTemplateOutputDefinitions();
                }
            }
        }
コード例 #3
0
        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;
        }