Exemplo n.º 1
0
        public string CurrentInvoke(string js, CurrentInvokeKind kind = CurrentInvokeKind.None)
        {
            this.CheckNavigated();

            var browser = webBrowser1;
            var arg     = (ScriptingContext)browser.ObjectForScripting;

            if (kind == CurrentInvokeKind.Repost)
            {
                CurrentRepost();
            }
            string callback = xInvoke(browser, js);

            if (kind == CurrentInvokeKind.AjaxEvent)
            {
                arg.SetAjax(browser, AjaxBlockFlags.Event, "CurrentInvoke");
            }
            return(callback);
        }
Exemplo n.º 2
0
        public string CurrentInvoke(string js, CurrentInvokeKind kind = CurrentInvokeKind.None)
        {
            this.CheckNavigated();

            ScriptingContext arg    = null;
            string           result = MLA.Invoke(() =>
            {
                arg = (ScriptingContext)browser.ObjectForScripting;
                if (kind == CurrentInvokeKind.Repost)
                {
                    CurrentRepost();
                }
                string callback = ClientForm.xInvoke(browser, js);
                if (kind == CurrentInvokeKind.AjaxEvent)
                {
                    arg.SetAjax(browser, AjaxBlockFlags.Event, "CurrentInvoke");
                }
                return(callback);
            });

            if (arg == null)
            {
                throw new InvalidOperationException("CurrentInvoke NULL arg");
            }
            switch (kind)
            {
            case CurrentInvokeKind.Repost:
                arg.WaitHandle.WaitOne();
                break;

            case CurrentInvokeKind.AjaxEvent:
                arg.WaitAjax(this.SendReceiveTimeout, "CurrentInvoke");
                break;
            }
            return(result);
        }
Exemplo n.º 3
0
 public string CurrentInvoke(string js, CurrentInvokeKind kind = CurrentInvokeKind.None)
 {
     return((string)Call(CallPack.ActionName.CurrentInvoke, new object[] { js, kind }));
 }