示例#1
0
        public void CSharpCallback()
        {
            var frame = _instanceBrowser.GetBrowser().MainFrame;

            var key = Guid.NewGuid().ToString();

            CallBackContainer.RegisterCallbackAction(key, data =>
            {
                MessageBox.Show(data);
            });
            var task = frame.EvaluateScriptAsync($"new ngService.TestService().getOrder(\"{key.ToString()}\")", null);

            task.ContinueWith(t =>
            {
                if (!t.IsFaulted)
                {
                    var response = t.Result;
                    var evaluateJavaScriptResult = (response.Success ? (response.Result ?? "null") : response.Message);
                    //MessageBox.Show(evaluateJavaScriptResult.ToString());
                }
            }, TaskScheduler.Default);
        }
示例#2
0
 public void NetCallbackAsync(string actionId, string jsonData)
 {
     CallBackContainer.Execute(actionId, jsonData);
 }