Ejemplo n.º 1
0
 public void Dispose()
 {
     _Context.RunAsync(() =>
     {
         if (_JavascriptSessionInjector != null)
         {
             _JavascriptSessionInjector.Dispose();
             _JavascriptSessionInjector = null;
         }
     });
 }
Ejemplo n.º 2
0
        public void Dispose()
        {
            if (ListenToCSharp)
            {
                UnlistenToCSharpChanges();
            }

            if (_SessionInjector != null)
            {
                _SessionInjector.Dispose();
                _SessionInjector = null;
            }

            _UnrootedEntities.Clear();
        }
Ejemplo n.º 3
0
        internal BidirectionalMapper(object iRoot, IWebView iwebview, IDispatcher UIDispatcher, JavascriptBindingMode iMode, object iadd)
        {
            _IWebView = iwebview;
            _JSObjectBuilder = new CSharpToJavascriptMapper(iwebview,UIDispatcher, this);
            _Root = _JSObjectBuilder.Map(iRoot, iadd);
            _UnrootedEntities = new List<IJSCSGlue>();
            _BindingMode = iMode;

            IJavascriptListener JavascriptObjecChanges = null;
            if (iMode == JavascriptBindingMode.TwoWay)
                JavascriptObjecChanges = this;


            _SessionInjector = new JavascriptSessionInjector(iwebview, JavascriptObjecChanges);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        internal BidirectionalMapper(object iRoot, IWebView iwebview, IDispatcher UIDispatcher, JavascriptBindingMode iMode, object iadd)
        {
            _IWebView         = iwebview;
            _JSObjectBuilder  = new CSharpToJavascriptMapper(iwebview, UIDispatcher, this);
            _Root             = _JSObjectBuilder.Map(iRoot, iadd);
            _UnrootedEntities = new List <IJSCSGlue>();
            _BindingMode      = iMode;

            IJavascriptListener JavascriptObjecChanges = null;

            if (iMode == JavascriptBindingMode.TwoWay)
            {
                JavascriptObjecChanges = this;
            }


            _SessionInjector = new JavascriptSessionInjector(iwebview, JavascriptObjecChanges);
        }
Ejemplo n.º 6
0
 internal StringBinding(IWebView context, IJavascriptObject root, JavascriptSessionInjector iJavascriptSessionInjector)
 {
     _JavascriptSessionInjector = iJavascriptSessionInjector;
     _Context = context;
     _Root = root;
 }
Ejemplo n.º 7
0
        public void Dispose()
        {
            if (ListenToCSharp)
                UnlistenToCSharpChanges();

            if (_SessionInjector != null)
            {
                _SessionInjector.Dispose();
                _SessionInjector = null;
            }

            _UnrootedEntities.Clear();
        }