private void Btn_ZoomToLayer_Click(object sender, EventArgs e) { if (m_selectedLayer != null) { (Ctrl_Map.Map as IActiveView).Extent = m_selectedLayer.AreaOfInterest; Ctrl_Map.Refresh(); } }
private object RequestResponder(OperationType type, object param = null) { switch (type) { case OperationType.SentStyleGalleryItem: m_pStyleGalleryItem = param as IStyleGalleryItem; return(null); case OperationType.GetViewIndex: return(Ctrl_Tab.SelectedIndex); case OperationType.GetSelectedLayer: return(m_selectedLayer); case OperationType.RefreshMapCtrl: Ctrl_Map.Refresh(); return(null); case OperationType.UpdateTOCCtrl: Ctrl_TOC.Update(); return(null); case OperationType.ClearSelection: Ctrl_Map.Map.ClearSelection(); return(null); case OperationType.ModifyExtent: Ctrl_Map.Extent = param as IEnvelope; return(null); case OperationType.GetMap: return(Ctrl_Map.Map); case OperationType.GetScene: return(Ctrl_Scene.Scene); case OperationType.ZoomToSelection: ICommand curCmd = new ControlsZoomToSelectedCommandClass(); curCmd.OnCreate(Ctrl_Map.Object); curCmd.OnClick(); return(null); case OperationType.FormAttributeHighLightRow: if (m_FrmAttribute != null) { m_FrmAttribute.HightLightSelection(); } return(null); default: return(null); } }
private void Btn_DeleteSelection_Click(object sender, EventArgs e) { IFeatureClass curFeatureClass = (m_selectedLayer as IFeatureLayer).FeatureClass; (m_selectedLayer as IFeatureSelection).SelectionSet.Search(null, true, out ICursor cursor); IFeatureCursor searchCursor = cursor as IFeatureCursor; IFeature pFeature; while ((pFeature = searchCursor.NextFeature()) != null) { curFeatureClass.GetFeature(pFeature.OID).Delete(); } (m_selectedLayer as IFeatureLayer).FeatureClass = curFeatureClass; Ctrl_Map.Refresh(); }