コード例 #1
0
ファイル: MainForm.cs プロジェクト: batuZ/Samples
        void axRenderControl1_RcMouseClickSelect(IPickResult PickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender)
        {
            IPickResult pr = PickResult;

            if (pr == null && CTRL && Mask == gviModKeyMask.gviModKeyCtrl)
            {
                return;
            }

            if (!CTRL || (CTRL && Mask != gviModKeyMask.gviModKeyCtrl))   //ctrl键
            {
                this.axRenderControl1.FeatureManager.UnhighlightAll();
            }

            if (EventSender == gviMouseSelectMode.gviMouseSelectClick)
            {
                if (PickResult != null)
                {
                    if (pr.Type == gviObjectType.gviObjectFeatureLayer)
                    {
                        IFeatureLayerPickResult flpr = pr as IFeatureLayerPickResult;
                        int           fid            = flpr.FeatureId;
                        IFeatureLayer fl             = flpr.FeatureLayer;
                        foreach (IFeatureClass fc in fcMap.Keys)
                        {
                            if (fc.Guid.Equals(fl.FeatureClassId))
                            {
                                this.axRenderControl1.FeatureManager.HighlightFeature(fc, fid, System.Drawing.Color.Yellow);
                            }
                        }

                        WindowParam wp = new WindowParam();
                        wp.FilePath          = @"D:\05_CityMaker_DeveloperKit\trunk\SDK\Samples\JS\beginner\HTMLWindow\PropertyWindow.html";
                        wp.Position          = gviHTMLWindowPosition.gviWinPosCenterParent;
                        wp.SizeX             = 200;
                        wp.SizeY             = 150;
                        wp.Hastitle          = false;
                        wp.IsPopupWindow     = false;
                        wp.UseMoveHoverEvent = true;
                        wp.HideOnClick       = false;
                        wp.WinId             = fid;
                        IHTMLWindow hw = this.axRenderControl1 as IHTMLWindow;
                        hw.ShowPopupWindowEx(IntersectPoint, wp, true);
                    }
                }
            }
        }