public TreeNode FindCarGenTreeNode(YmapCarGen cargen) { if (cargen == null) { return(null); } TreeNode ymapnode = FindYmapTreeNode(cargen.Ymap); if (ymapnode == null) { return(null); } var cargensnode = GetChildTreeNode(ymapnode, "CarGens"); if (cargensnode == null) { return(null); } for (int i = 0; i < cargensnode.Nodes.Count; i++) { TreeNode cargennode = cargensnode.Nodes[i]; if (cargennode.Tag == cargen) { return(cargennode); } } return(null); }
public void UpdateCarGenTreeNode(YmapCarGen cargen) { var tn = FindCarGenTreeNode(cargen); if (tn != null) { tn.Text = cargen.ToString(); } }
public void TrySelectCarGenTreeNode(YmapCarGen cargen) { TreeNode cargennode = FindCarGenTreeNode(cargen); if (cargennode != null) { ProjectTreeView.SelectedNode = cargennode; } }
public void RemoveCarGenTreeNode(YmapCarGen cargen) { var tn = FindCarGenTreeNode(cargen); if ((tn != null) && (tn.Parent != null)) { tn.Parent.Text = "Car Generators (" + cargen.Ymap.CarGenerators.Length.ToString() + ")"; tn.Parent.Nodes.Remove(tn); } }