/// <summary> /// 冲突分析 /// </summary> private void buttonConflict_Click(object sender, EventArgs e) { TreeNode node = treeView1.SelectedNode; if (node.Parent != null) { #region 采用系统自带对话框,保存选择路径 SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "Shp files|*.shp"; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { Conflict conflict = _ruleTree.GetSelectedNode(node) as Conflict; ///获取Zone PlanTree planTree = new PlanTree(); string planNameA = conflict.ZoneA.Name.Split('.')[0]; string zoneNameA = conflict.ZoneA.Name.Split('.')[1]; conflict.ZoneA = planTree.GetZone(planNameA, zoneNameA); string planNameB = conflict.ZoneB.Name.Split('.')[0]; string zoneNameB = conflict.ZoneB.Name.Split('.')[1]; conflict.ZoneB = planTree.GetZone(planNameB, zoneNameB); textBox3.Text = dialog.FileName; conflict.Address = dialog.FileName; conflict.ConflictAnalysis(); conflict.Name = conflict.Name.Replace(".shp", ""); _ruleTree.SaveConflictPath(dialog.FileName, node.Parent.Text, conflict.Name); } #endregion } else { MessageBox.Show("请选择冲突!"); } }