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