Exemplo n.º 1
0
 private void panel1_Paint(object sender, PaintEventArgs e)
 {
     try
     {
         foreach (Control ctl in panel1.Controls)
         {
             if (ctl is CheckBox)
             {
                 if (ctl.Tag != null)
                 {
                     //if (CConst.LayerExists(ctl.Tag.ToString()))
                     if (CMedToolsSubs.layerExists(ctl.Tag.ToString() + ".lyr", SConst.LayerLocation))
                     {
                         ctl.Enabled = true;
                     }
                     else
                     {
                         ctl.Enabled = false;
                     }
                 }
                 else
                 {
                     ctl.Enabled = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message;
         s += " - -- that was it";
     }
 }
Exemplo n.º 2
0
 private void panel1_Paint(object sender, PaintEventArgs e)
 {
     foreach (Control ctl in panel1.Controls)
     {
         if (ctl is CheckBox)
         {
             if (ctl.Tag != null)
             {
                 //if (CConst.LayerExists(ctl.Tag.ToString()))
                 if (CMedToolsSubs.layerExists(ctl.Tag.ToString() + ".lyr", SConst.LayerLocation))
                 {
                     ctl.Enabled = true;
                 }
                 else
                 {
                     ctl.Enabled = false;
                 }
             }
             else
             {
                 ctl.Enabled = false;
             }
         }
     }
 }
Exemplo n.º 3
0
        private void loadLayers(ref IMap pMap, Dictionary <string, string> dctLayers, Collection <string> colOnLayers)
        {
            Collection <string> colMissingLayers = new Collection <string>();
            CSpatialSubs        oSpatialSubs     = new CSpatialSubs();

            try
            {
                foreach (KeyValuePair <string, string> pair in dctLayers)
                {
                    if (CMedToolsSubs.layerExists(dctLayers[pair.Key].ToString(), "I://GIS//Layers//"))               // SConst.LayerLocation))
                    {
                        pMap.AddLayer(oSpatialSubs.returnLayer(dctLayers[pair.Key].ToString(), "I://GIS//Layers//")); //  SConst.LayerLocation));
                    }
                    else
                    {
                        colMissingLayers.Add(pair.Key);
                    }
                }

                for (int i = 0; i < pMap.LayerCount; i++)
                {
                    ILayer pLayer = pMap.get_Layer(i);
                    if (!colMissingLayers.Contains(pLayer.Name))
                    {
                        if (!colOnLayers.Contains(pLayer.Name))
                        {
                            pLayer.Visible = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                oSpatialSubs.Dispose();
            }
        }