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;
}