using System; using System.Collections.Generic; using System.Windows.Forms; using DevComponents.DotNetBar; using GeoScene.Globe; namespace Cyberpipe { public partial class FrmSetGoalLayer : Office2007Form { GSOGlobeControl globeControl1; List<string> pipeLayerNames; string str = ""; public FrmSetGoalLayer(GSOGlobeControl globeControl, List<string> _list,string _str) { InitializeComponent(); globeControl1 = globeControl; pipeLayerNames = _list; str = _str; } /// <summary> /// 窗体初始化事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmSetGoalLayer_Load(object sender, EventArgs e) { for (int i = 0; i < pipeLayerNames.Count; i++) { if (pipeLayerNames[i].EndsWith(str)) { cmbPipeShow.Items.Add(pipeLayerNames[i]); } } if (cmbPipeShow.Items.Count <= 0) { return; } cmbPipeShow.SelectedIndex = 0; } /// <summary> /// 确定按钮事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEnter_Click(object sender, EventArgs e) { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(cmbPipeShow.Text); if (layer != null) { layer.Editable = true; globeControl1.Globe.DestLayerFeatureAdd = layer; DialogResult = DialogResult.OK; } } } }