private void ExtractList1(byte[] fData) { if (List1Start <= 0) { return; } if (List1End <= 0) { return; } if (List1End <= List1Start) { return; } NodeCount = 0; Nodes.Clear(); for (int lstPoint = List1Start; lstPoint < List1End; lstPoint += 4) { int entry = BitConverter.ToInt32(fData, lstPoint); string childType = GetTypeFromPointer(BitConverter.ToInt32(fData, entry)); if ((childType == "CNode") || (childType == "CModel") || childType == "CWorld") { CA_Node tNode = new CA_Node(); tNode.ExtractNode(fData, entry); tNode.Parent = this; //AddNode(tNode); Nodes.Add(tNode); NodeCount++; } } }
private void nodeTree_AfterSelect_1(object sender, TreeViewEventArgs e) { CA_Node cNode = cNode = (CA_Node)e.Node.Tag; textBox1.Text = cNode.ToString(); //MessageBox.Show(cNode.StringID.ToString("X8") + "\nParent: " + cNode.Parent.StringID.ToString("X8")); }
private void AddChildNode(CA_Node cNode, TreeNode tNode) { TreeNode child = new TreeNode(); child.Text = cNode.NodeType + ":" + cNode.StringID.ToString("X8"); child.Tag = cNode; tNode.Nodes.Add(child); for (int i = 0; i < cNode.Nodes.Count(); i++) { AddChildNode(cNode.Nodes.ElementAt(i), child); } }
private void FillTreeNode(CA_Node cNode) { TreeNode tNode = new TreeNode(); tNode.Text = cNode.NodeType + ":" + cNode.StringID.ToString("X8"); tNode.Tag = cNode; nodeTree.Nodes.Add(tNode); for (int i = 0; i < cNode.Nodes.Count(); i++) { AddChildNode(cNode.Nodes.ElementAt(i), tNode); } }