コード例 #1
0
ファイル: IpcSender.cs プロジェクト: tarynt/AspNetCore
    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());
    }
コード例 #2
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
    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);
    }
コード例 #3
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
    public void NotifyUnhandledException(Exception exception)
    {
        var message = IpcCommon.Serialize(IpcCommon.OutgoingMessageType.NotifyUnhandledException, exception.Message, exception.StackTrace);

        _dispatcher.InvokeAsync(() => _messageDispatcher(message));
    }
コード例 #4
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
 public void SendByteArray(int id, byte[] data)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.SendByteArrayToJS, id, data));
 }
コード例 #5
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
 public void EndInvokeDotNet(string callId, bool success, string invocationResultOrError)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.EndInvokeDotNet, callId, success, invocationResultOrError));
 }
コード例 #6
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
 public void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.BeginInvokeJS, taskId, identifier, argsJson, resultType, targetInstanceId));
 }
コード例 #7
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
 public void AttachToDocument(int componentId, string selector)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.AttachToDocument, componentId, selector));
 }
コード例 #8
0
ファイル: IpcSender.cs プロジェクト: pa-at/aspnetcore
 public void Navigate(string uri, NavigationOptions options)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.Navigate, uri, options));
 }
コード例 #9
0
ファイル: IpcSender.cs プロジェクト: tarynt/AspNetCore
 public void EndLocationChanging(int callId, bool shouldContinueNavigation)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.EndLocationChanging, callId, shouldContinueNavigation));
 }
コード例 #10
0
ファイル: IpcSender.cs プロジェクト: tarynt/AspNetCore
 public void SetHasLocationChangingListeners(bool hasListeners)
 {
     DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.SetHasLocationChangingListeners, hasListeners));
 }