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); }
public void NetCallbackAsync(string actionId, string jsonData) { CallBackContainer.Execute(actionId, jsonData); }