private void FillCompLayer(ICompositeLayer compLayer)
        {
            for (int i = 0; i < compLayer.Count; i++)
            {
                ILayer layer = compLayer.Layer[i];
                if (layer is IGroupLayer)
                {
                    this.FillCompLayer(layer as ICompositeLayer);
                }
                else if (layer is IFeatureLayer)
                {
                    IFeatureLayer featureLayer = layer as IFeatureLayer;
                    LayerItem     item         = new LayerItem(featureLayer.Name, featureLayer);
                    bool          checkState;
                    if (!featureLayer.Selectable)
                    {
                        checkState = false;
                    }
                    else
                    {
                        checkState = true;
                    }

                    this.checkedListBoxControl.Items.Add(item, checkState);
                }
            }
        }
        private void frmSetSelectableLayer_Load(object sender, EventArgs e)
        {
            //_layers.Clear();
            _isInit = true;
            for (int i = 0; i < this._mMap.LayerCount; i++)
            {
                ILayer layer = this._mMap.Layer[i];
                if (layer is IGroupLayer)
                {
                    this.FillCompLayer(layer as ICompositeLayer);
                }
                else if (layer is IFeatureLayer)
                {
                    IFeatureLayer featureLayer = layer as IFeatureLayer;
                    LayerItem     item         = new LayerItem(featureLayer.Name, featureLayer);
                    CheckState    checkState;
                    if (!featureLayer.Selectable)
                    {
                        checkState = CheckState.Unchecked;
                    }
                    else
                    {
                        checkState = CheckState.Checked;
                    }

                    this.checkedListBoxControl.Items.Add(item, checkState);
                }
            }
            _isInit = false;
        }