IfcDoc.FormEdit.ctlExpressG_SelectionChanged C# (CSharp) Method

ctlExpressG_SelectionChanged() private method

private ctlExpressG_SelectionChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void ctlExpressG_SelectionChanged(object sender, EventArgs e)
        {
            // update tree; optimize -- selection can only change to within current schema
            TreeNode node = this.treeView.SelectedNode;
            while(!(node.Tag is DocSchema))
            {
                node = node.Parent;
            }

            if (this.ctlExpressG.Selection == null)
            {
                // select schema
                this.treeView.SelectedNode = node;
                return;
            }

            if (this.ctlExpressG.Selection is DocObject)
            {
                UpdateTreeSelection(node, (DocObject)this.ctlExpressG.Selection);
            }

            bool multiselect = (this.ctlExpressG.Multiselection.Count > 1);
            this.toolStripMenuItemDiagramAlign.Enabled = multiselect;
            this.toolStripMenuItemDiagramSize.Enabled = multiselect;
            this.toolStripMenuItemDiagramSpaceHorz.Enabled = multiselect;
            this.toolStripMenuItemDiagramSpaceVert.Enabled = multiselect;
        }
FormEdit