public void NotifyUnhandledException(Exception exception) { // Send the serialized exception to the WebView for display var message = IpcCommon.Serialize(IpcCommon.OutgoingMessageType.NotifyUnhandledException, exception.Message, exception.StackTrace); _dispatcher.InvokeAsync(() => _messageDispatcher(message)); // Also rethrow so the AppDomain's UnhandledException handler gets notified _dispatcher.InvokeAsync(() => ExceptionDispatchInfo.Capture(exception).Throw()); }
public void ApplyRenderBatch(long batchId, RenderBatch renderBatch) { var arrayBuilder = new ArrayBuilder <byte>(2048); using var memoryStream = new ArrayBuilderMemoryStream(arrayBuilder); using (var renderBatchWriter = new RenderBatchWriter(memoryStream, false)) { renderBatchWriter.Write(in renderBatch); } var message = IpcCommon.Serialize(IpcCommon.OutgoingMessageType.RenderBatch, batchId, Convert.ToBase64String(arrayBuilder.Buffer, 0, arrayBuilder.Count)); DispatchMessageWithErrorHandling(message); }
public void NotifyUnhandledException(Exception exception) { var message = IpcCommon.Serialize(IpcCommon.OutgoingMessageType.NotifyUnhandledException, exception.Message, exception.StackTrace); _dispatcher.InvokeAsync(() => _messageDispatcher(message)); }
public void SendByteArray(int id, byte[] data) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.SendByteArrayToJS, id, data)); }
public void EndInvokeDotNet(string callId, bool success, string invocationResultOrError) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.EndInvokeDotNet, callId, success, invocationResultOrError)); }
public void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.BeginInvokeJS, taskId, identifier, argsJson, resultType, targetInstanceId)); }
public void AttachToDocument(int componentId, string selector) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.AttachToDocument, componentId, selector)); }
public void Navigate(string uri, NavigationOptions options) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.Navigate, uri, options)); }
public void EndLocationChanging(int callId, bool shouldContinueNavigation) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.EndLocationChanging, callId, shouldContinueNavigation)); }
public void SetHasLocationChangingListeners(bool hasListeners) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.SetHasLocationChangingListeners, hasListeners)); }