Пример #1
0
        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);
        }
Пример #2
0
        public void UpdateCarGenTreeNode(YmapCarGen cargen)
        {
            var tn = FindCarGenTreeNode(cargen);

            if (tn != null)
            {
                tn.Text = cargen.ToString();
            }
        }
Пример #3
0
        public void TrySelectCarGenTreeNode(YmapCarGen cargen)
        {
            TreeNode cargennode = FindCarGenTreeNode(cargen);

            if (cargennode != null)
            {
                ProjectTreeView.SelectedNode = cargennode;
            }
        }
Пример #4
0
        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);
            }
        }