Newer
Older
GHFX_REFACTOR / FrmSetGoalLayer.cs
wxn on 2 Nov 2016 1 KB 提交
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GeoScene.Globe;

namespace Cyberpipe
{
    public partial class FrmSetGoalLayer : DevComponents.DotNetBar.Office2007Form
    {
        GSOGlobeControl globeControl1;
        List<string> pipeLayerNames;
        string str = "";

        public FrmSetGoalLayer(GeoScene.Globe.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;
                this.DialogResult = DialogResult.OK;
            }
        }
    }
}