/// <summary> /// 查找 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void bFind_Click(object sender, EventArgs e) { FindForm fForm = new FindForm(); fForm.AISetCount = leftLogicalData.NumAISetCount; fForm.WayPointSetCount = leftLogicalData.NumWapPointSet; fForm.NpcCount = leftLogicalData.NumNPC; fForm.DoodadCount = leftLogicalData.NumDoodad; fForm.AIGroupCount = leftLogicalData.NumAIGroup; fForm.LogicalPolyCount = leftLogicalData.NumLogicalPoly; fForm.TrafficPointCount = leftLogicalData.NumTrafficPoint; fForm.TrafficPointSetCount = leftLogicalData.NumTrafficPointSet; fForm.NpcReviveGroupsCount = leftLogicalData.NumNpcReviveGroup; fForm.DoodadReviveGroupsCount = leftLogicalData.NumDoodadReviveGroup; fForm.NpcRandomGroupsCount = leftLogicalData.NumNpcRandomGroup; if (fForm.ShowDialog() == DialogResult.OK) { Node sectionNode = null; string keyName = string.Format("{0}{1}", fForm.SectionName, fForm.KeyIndex); switch (fForm.SectionName) { case "AISet": { sectionNode = itemTree.Nodes[1]; break; } case "WayPointSet": { sectionNode = itemTree.Nodes[2]; break; } case "NPC": { sectionNode = itemTree.Nodes[3]; break; } case "Doodad": { sectionNode = itemTree.Nodes[4]; break; } case "AIGroup": { sectionNode = itemTree.Nodes[5]; break; } case "LogicalPoly": { sectionNode = itemTree.Nodes[6]; break; } case "TrafficPoint": { sectionNode = itemTree.Nodes[7]; break; } case "TrafficPointSet": { sectionNode = itemTree.Nodes[8]; break; } case "NpcReviveSection": { sectionNode = itemTree.Nodes[9]; break; } case "DoodadReviveSection": { sectionNode = itemTree.Nodes[10]; break; } case "NpcRandomSection": { sectionNode = itemTree.Nodes[11]; break; } } if (sectionNode != null) { foreach (Node node in sectionNode.Nodes) { if (node.Text == keyName) { itemTree.SelectedNode = node; break; } } } } }