GetNode() public method

public GetNode ( int id ) : TreeNode
id int
return TreeNode
示例#1
0
 private void VerifySelection(TreeData treeData)
 {
     TreeGroup g = s_SelectedGroup;
     TreeNode node = s_SelectedNode;
     if (g != null)
     {
         g = treeData.GetGroup(g.uniqueID);
     }
     if (node != null)
     {
         node = treeData.GetNode(node.uniqueID);
     }
     if (((g != treeData.root) && (g != null)) && !treeData.IsAncestor(treeData.root, g))
     {
         g = null;
         node = null;
     }
     if ((node != null) && (treeData.GetGroup(node.groupID) != g))
     {
         node = null;
     }
     if (g == null)
     {
         g = treeData.root;
     }
     if ((s_SelectedGroup == null) || (g != s_SelectedGroup))
     {
         this.SelectGroup(g);
         if (node != null)
         {
             this.SelectNode(node, treeData);
         }
     }
 }
示例#2
0
		private void VerifySelection(TreeData treeData)
		{
			TreeGroup treeGroup = TreeEditor.s_SelectedGroup;
			TreeNode treeNode = TreeEditor.s_SelectedNode;
			if (treeGroup != null)
			{
				treeGroup = treeData.GetGroup(treeGroup.uniqueID);
			}
			if (treeNode != null)
			{
				treeNode = treeData.GetNode(treeNode.uniqueID);
			}
			if (treeGroup != treeData.root && treeGroup != null && !treeData.IsAncestor(treeData.root, treeGroup))
			{
				treeGroup = null;
				treeNode = null;
			}
			if (treeNode != null && treeData.GetGroup(treeNode.groupID) != treeGroup)
			{
				treeNode = null;
			}
			if (treeGroup == null)
			{
				treeGroup = treeData.root;
			}
			if (TreeEditor.s_SelectedGroup != null && treeGroup == TreeEditor.s_SelectedGroup)
			{
				return;
			}
			this.SelectGroup(treeGroup);
			if (treeNode != null)
			{
				this.SelectNode(treeNode, treeData);
			}
		}