示例#1
0
 private void axTOCControl_OnDoubleClick(object sender, ITOCControlEvents_OnDoubleClickEvent e)
 {
     esriTOCControlItem itemType = esriTOCControlItem.esriTOCControlItemNone;
     IBasicMap basicMap = null;
     ILayer layer = null;
     object unk = null;
     object data = null;
     this.axTOCControl.HitTest(e.x, e.y, ref itemType, ref basicMap, ref layer, ref unk, ref data);
     //this.axTOCControl.GetSelectedItem(ref itemType, ref basicMap, ref layer, ref unk, ref data);
     //if (itemType == esriTOCControlItem.esriTOCControlItemLayer)
     //{
     //    if (layer is IGeoFeatureLayer)
     //    {
     //        FeatLyrFrm newFeatLyrFrm = new FeatLyrFrm(layer);
     //        newFeatLyrFrm.Show();
     //    }
     //}
     switch (itemType)
     {
         case esriTOCControlItem.esriTOCControlItemLayer:
             if (layer is IGeoFeatureLayer)
             {
                 if (this.newFeatLyrFrm == null)
                 {
                     this.newFeatLyrFrm = new FeatLyrFrm();
                 }
                 this.newFeatLyrFrm.Layer = layer;
                 if (this.newFeatLyrFrm.ShowDialog() == DialogResult.OK)
                 {
                     this.mainMapControl.Refresh();
                     this.EagleaxMapControl.Refresh();
                     this.axTOCControl.Update();
                 }
             }
             break;
         case esriTOCControlItem.esriTOCControlItemLegendClass:
             break;
     }
 }
示例#2
0
 private void ctMenuTFProperties_Click(object sender, EventArgs e)
 {
     if (this.newFeatLyrFrm == null)
     {
         this.newFeatLyrFrm = new FeatLyrFrm();
     }
     this.newFeatLyrFrm.Layer = this.TOCRightLayer;
     if (this.newFeatLyrFrm.ShowDialog() == DialogResult.OK)
     {
         this.mainMapControl.Refresh();
         this.EagleaxMapControl.Refresh();
         this.axTOCControl.Update();
     }
 }