コード例 #1
0
        public void InitUI() //初始化
        {
            string     sClsName    = string.Empty;
            OperateMap _operateMap = new OperateMap();

            _lstFeatCls = _operateMap.GetLstFeatCls(_map);  //获得图层信息
            foreach (IFeatureClass pFeatCls in _lstFeatCls) //循环
            {
                sClsName = pFeatCls.AliasName;              //获得图层名字
                if (!comboBox1.Items.Contains(sClsName))    //若原选择框中不包含此名字,将此图层名添加至选择框值
                {
                    comboBox1.Items.Add(sClsName);
                }
            }
        }
コード例 #2
0
        public void InitUI()
        {
            string sClsName = string.Empty;

            cmbSelLyr.Items.Clear();
            IFeatureClass pFeatCls    = null;
            OperateMap    _OperateMap = new OperateMap();

            _lstFeatCls = _OperateMap.GetLstFeatCls(_map);
            for (int i = 0; i < _lstFeatCls.Count; i++)
            {
                pFeatCls = _lstFeatCls[i];
                sClsName = pFeatCls.AliasName;
                if (!cmbSelLyr.Items.Contains(sClsName))
                {
                    cmbSelLyr.Items.Add(sClsName);
                }
            }
        }