示例#1
0
        private void goToNodeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MyNode targetNode = null;

            if (Observer.GenericTarget is MyNode)
            {
                targetNode = Observer.GenericTarget as MyNode;
            }
            else if (Observer.GenericTarget is MyAbstractMemoryBlock)
            {
                targetNode = (Observer.GenericTarget as MyAbstractMemoryBlock).Owner;
            }

            if (targetNode != null)
            {
                if (targetNode is MyWorld)
                {
                    GraphLayoutForm graphForm = m_mainForm.OpenGraphLayout(targetNode.Owner.Network);
                    graphForm.worldButton_Click(sender, EventArgs.Empty);
                }
                else
                {
                    GraphLayoutForm graphForm = m_mainForm.OpenGraphLayout(targetNode.Parent);
                    graphForm.SelectNodeView(targetNode);
                }
            }
        }
示例#2
0
 private void GoToNode(object sender, MyNode node)
 {
     if (node is MyWorld)
     {
         GraphLayoutForm graphForm = m_mainForm.OpenGraphLayout(node.Owner.Network);
         graphForm.worldButton_Click(sender, EventArgs.Empty);
     }
     else
     {
         GraphLayoutForm graphForm = m_mainForm.OpenGraphLayout(node.Parent);
         graphForm.SelectNodeView(node);
     }
 }