public static async Task<IHTMLBinding> Bind(IHTMLWindow view, string iViewModel)
        {
            var context = view.MainFrame;

            var root = await context.EvaluateAsync(() =>
                {
                    var json = context.GetGlobal().GetValue("JSON");
                    return json.Invoke("parse", context, context.Factory.CreateString(iViewModel));
                });

            var injector = new JavascriptSessionInjector(context, null);
            var mappedroot = injector.Map(root, null);
            await injector.RegisterInSession(mappedroot);

            return new StringBinding(context, mappedroot, injector);
        }
Beispiel #2
0
        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);
                    }
                }
            }
        }
Beispiel #3
0
        private void AxRenderControl1_RcHTMLWindowMouseHover(int WinId, bool IsMouseHover)
        {
            IHTMLWindow  htmWnd = this.axRenderControl1 as IHTMLWindow;
            IWindowParam wp     = htmWnd.GetWindowParam(WinId);

            if (IsMouseHover)
            {
                wp.OffsetX -= 50;
                wp.OffsetY -= 100;
                wp.SizeX   += 100;
                wp.SizeY   += 100;
            }
            else
            {
                wp.OffsetX += 50;
                wp.OffsetY += 100;
                wp.SizeX   -= 100;
                wp.SizeY   -= 100;
            }
            htmWnd.SetWindowParam(wp);
        }