Ejemplo n.º 1
0
        private void gvResult_DoubleClick(object sender, EventArgs e)
        {
            if (this.m_ContentType == enumContentType.Rule)
                return;

            DataRow rowError = gvResult.GetFocusedDataRow();
            if (rowError == null)
                return;

            if (this.m_HookHelper.FocusMap != null)
            {
                IMap theMap = this.m_HookHelper.FocusMap;
                theMap.ClearSelection();

                string strTargetLayer = rowError[Field_Name_TargetLayer] as string;
                if ((enumErrorType)rowError["ErrorType"] == enumErrorType.Topology)
                    strTargetLayer = rowError["TPTC"] as string;

                MapLayersController mapController = new MapLayersController(theMap);
                mapController.SetAllLayersVisible(false);
                mapController.SetLayerVisible(strTargetLayer, true);
                if (rowError.Table.Columns.Contains(Field_Name_ReferLayer))
                {
                    string strReferLayer = rowError[Field_Name_ReferLayer] as string;
                    mapController.SetLayerVisible(strReferLayer, true);
                }

                IFeature fRefer = null;
                IFeature fError=GetErrorFeature(rowError,ref fRefer);
                if (this.SelectedErrorFeatureChanged != null)
                    this.SelectedErrorFeatureChanged.Invoke(fError,fRefer);

                //if (fRefer!=null && this.SelectedReferFeatureChanged != null)
                //    this.SelectedReferFeatureChanged.Invoke(fRefer);

                if (fError != null)
                {
                    Hy.Common.Utility.Esri.MapOperAPI.ZoomToFeature(Control.FromHandle((IntPtr)(this.m_HookHelper.Hook as IMapControl2).hWnd) as AxMapControl, fError.Shape);
                    Hy.Common.Utility.Esri.MapOperAPI.FlashGeometry(this.m_HookHelper.Hook as IMapControl4, fError.Shape);
                }

            }
        }