IfcDoc.CtlRules.toolStripButtonTemplateUpdate_Click C# (CSharp) Method

toolStripButtonTemplateUpdate_Click() private method

private toolStripButtonTemplateUpdate_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        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, this.m_project, this.m_template))
                    {
                        form.ShowDialog(this);
                    }
                }

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

                // propagate rule
                this.m_template.PropagateRule(this.treeViewTemplate.SelectedNode.FullPath);
            }
        }