Exemple #1
0
        private void toolStripButtonTemplateUpdate_Click(object sender, EventArgs e)
        {
            if (this.treeViewTemplate.SelectedNode != null && this.treeViewTemplate.SelectedNode.Tag is DocModelRule)
            {
                DocModelRule docRule = (DocModelRule)this.treeViewTemplate.SelectedNode.Tag;
                if (docRule is DocModelRuleConstraint)
                {
                    using (FormConstraint form = new FormConstraint())
                    {
                        form.Expression = docRule.Description;
                        DialogResult res = form.ShowDialog(this);
                        if (res == DialogResult.OK)
                        {
                            docRule.Description = form.Expression;
                            docRule.Name        = form.Expression; // repeat for visibility
                        }
                    }
                }
                else
                {
                    using (FormRule form = new FormRule(docRule))
                    {
                        form.ShowDialog(this);
                    }
                }

                // update text in treeview
                this.UpdateTemplateGraph(this.treeViewTemplate.SelectedNode);

                // propagate rule
                this.m_template.PropagateRule(this.treeViewTemplate.SelectedNode.FullPath);
            }
        }
Exemple #2
0
        private void toolStripButtonTemplateUpdate_Click(object sender, EventArgs e)
        {
            if (this.treeViewTemplate.SelectedNode != null && this.treeViewTemplate.SelectedNode.Tag is DocModelRule)
            {
                DocModelRule docRule = (DocModelRule)this.treeViewTemplate.SelectedNode.Tag;
                if (docRule is DocModelRuleConstraint)
                {
                    using (FormConstraint form = new FormConstraint())
                    {
                        form.Expression = docRule.Description;
                        DialogResult res = form.ShowDialog(this);
                        if (res == DialogResult.OK)
                        {
                            docRule.Description = form.Expression;
                            docRule.Name = form.Expression; // repeat for visibility
                        }
                    }
                }
                else
                {
                    using (FormRule form = new FormRule(docRule))
                    {
                        form.ShowDialog(this);
                    }
                }

                // update text in treeview
                this.UpdateTemplateGraph(this.treeViewTemplate.SelectedNode);

                // propagate rule
                this.m_template.PropagateRule(this.treeViewTemplate.SelectedNode.FullPath);
            }
        }
Exemple #3
0
 private void ctlConcept_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     // if link mode, insert a rule
     if (this.ctlExpressG.Mode == ToolMode.Select)
     {
         if (this.ctlConcept.Selection != null)
         {
             using (FormRule form = new FormRule(this.ctlConcept.Selection, this.m_project, this.ctlConcept.Template))
             {
                 DialogResult res = form.ShowDialog(this);
                 if (res == System.Windows.Forms.DialogResult.OK)
                 {
                     this.ctlConcept.Redraw();
                 }
             }
         }
     }
     else if(this.ctlExpressG.Mode == ToolMode.Move)
     {
         this.ctlProperties.DoInsert(this.ctlExpressG.Mode);
     }
     else if (this.ctlExpressG.Mode == ToolMode.Link)
     {
         this.ctlProperties.DoInsert(this.ctlExpressG.Mode);
     }
 }