Exemplo n.º 1
0
        public static void DeleteLayer(IBasicMap pMap, string layerName)
        {
            int num = 0;

            while (true)
            {
                if (num < pMap.LayerCount)
                {
                    ILayer layer = pMap.Layer[num];
                    if (layer.Name == layerName)
                    {
                        pMap.DeleteLayer(layer);
                        break;
                    }
                    else
                    {
                        num++;
                    }
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public static void DeleteLayer(IBasicMap ibasicMap_0, string string_0)
 {
     for (int i = 0; i < ibasicMap_0.LayerCount; i++)
     {
         ILayer pLayer = ibasicMap_0.get_Layer(i);
         if (pLayer.Name == string_0)
         {
             ibasicMap_0.DeleteLayer(pLayer);
             break;
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            ClsGlobal.GetSelectedMapAndLayer(m_pTocCtl, ref m_pMap, ref m_pLayer);

            if (m_pMap != null && m_pLayer != null)
            {
                m_pMap.DeleteLayer(m_pLayer);

                m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                m_pTocCtl.Update();
                if (m_pBar.Visible == true && m_pBar.Text == m_pLayer.Name)
                {
                    m_pDataTable.Clear();
                    m_pDataTable.Columns.Clear();
                    m_pBar.Visible = false;
                }
            }
        }