private void openSelectedElements()
 {
     foreach (ListViewItem item in this.navigateListView.SelectedItems)
     {
         UML.UMLItem element = item.Tag as UML.UMLItem;
         if (null != element)
         {
             element.open();
         }
         //if the element is a diagram then also select the context
         if (element is UML.Diagrams.Diagram)
         {
             ((UML.Diagrams.Diagram)element).selectItem(context);
         }
     }
 }
Ejemplo n.º 2
0
 private void selectInProjectBrowser()
 {
     UML.UMLItem selectedElement = this.NavigatorTree.SelectedNode.Tag as UML.UMLItem;
     if (selectedElement != null)
     {
         //select the context before opening the element (and changing the selected node)
         UML.UMLItem context = null;
         if (selectedElement is UML.Diagrams.Diagram)
         {
             context = this.findContext(this.NavigatorTree.SelectedNode);
         }
         //actually open element
         selectedElement.open();
         //select the context if the selected element was a diagram
         if (context != null)
         {
             ((UML.Diagrams.Diagram)selectedElement).selectItem(context);
         }
     }
 }