63 references to DotNetDispatcher
Microsoft.AspNetCore.Components.Server (3)
Circuits\CircuitHost.cs (3)
379
DotNetDispatcher
.BeginInvokeDotNet(JSRuntime, invocationInfo, argsJson);
413
DotNetDispatcher
.EndInvokeJS(JSRuntime, arguments);
438
DotNetDispatcher
.ReceiveByteArray(JSRuntime, id, data);
Microsoft.AspNetCore.Components.WebAssembly (4)
Services\DefaultWebAssemblyJSRuntime.cs (4)
51
return
DotNetDispatcher
.Invoke(Instance, callInfo, argsJson);
62
DotNetDispatcher
.EndInvokeJS(Instance, argsJson);
91
DotNetDispatcher
.BeginInvokeDotNet(Instance, state.callInfo, state.argsJson);
156
DotNetDispatcher
.ReceiveByteArray(Instance, id, data);
Microsoft.AspNetCore.Components.WebView (3)
IpcReceiver.cs (3)
77
DotNetDispatcher
.BeginInvokeDotNet(
85
DotNetDispatcher
.EndInvokeJS(pageContext.JSRuntime, argumentsOrError);
90
DotNetDispatcher
.ReceiveByteArray(pageContext.JSRuntime, id, data);
Microsoft.JSInterop (3)
Infrastructure\DotNetDispatcher.cs (2)
16
[assembly: MetadataUpdateHandler(typeof(Microsoft.JSInterop.Infrastructure.
DotNetDispatcher
.MetadataUpdateHandler))]
35
private static readonly MethodInfo _taskConverterMethodInfo = typeof(
DotNetDispatcher
).GetMethod(nameof(CreateValueTaskConverter), BindingFlags.NonPublic | BindingFlags.Static)!;
Infrastructure\DotNetObjectReferenceJsonConverter.cs (1)
18
private static JsonEncodedText DotNetObjectRefKey =>
DotNetDispatcher
.DotNetObjectRefKey;
Microsoft.JSInterop.Tests (50)
Infrastructure\DotNetDispatcherTest.cs (50)
21
() =>
DotNetDispatcher
.Invoke(new TestJSRuntime(), new DotNetInvocationInfo(assemblyName, "SomeMethod", default, default), "[]"),
33
() =>
DotNetDispatcher
.Invoke(new TestJSRuntime(), new DotNetInvocationInfo("SomeAssembly", methodIdentifier, default, default), "[]"),
44
DotNetDispatcher
.Invoke(new TestJSRuntime(), new DotNetInvocationInfo(assemblyName, "SomeMethod", default, default), null);
66
DotNetDispatcher
.Invoke(new TestJSRuntime(), new DotNetInvocationInfo(thisAssemblyName, methodIdentifier, default, default), null);
78
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, "InvocableStaticVoid", default, default), null);
90
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, "InvocableStaticNonVoid", default, default), null);
103
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, nameof(SomePublicType.InvokableMethodWithoutCustomIdentifier), default, default), null);
129
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, "InvocableStaticWithParams", default, default), argsJson);
144
Assert.True(resultDto2Ref.TryGetProperty(
DotNetDispatcher
.DotNetObjectRefKey.EncodedUtf8Bytes, out var property));
170
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, method, default, default), argsJson));
184
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, "InvokableInstanceVoid", 1, default), null);
201
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, "BaseClassInvokableInstanceVoid", 1, default), null);
218
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(null, "__Dispose", objectRef.ObjectId, default), null);
239
() =>
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, "InvokableInstanceVoid", 1, default), null));
258
() =>
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, "InvokableInstanceVoid", 1, default), null));
272
DotNetDispatcher
.EndInvokeJS(jsRuntime, argsJson);
293
DotNetDispatcher
.EndInvokeJS(jsRuntime, argsJson);
309
DotNetDispatcher
.EndInvokeJS(jsRuntime, argsJson);
330
DotNetDispatcher
.EndInvokeJS(jsRuntime, argsJson);
345
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.EndInvokeJS(jsRuntime, ""));
356
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"{{\"key\": \"{jsRuntime.LastInvocationAsyncHandle}\"}}"));
367
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, false"));
378
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, false, \"Hello\", 5]"));
393
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, false, \"Hello\", 5]");
408
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, true, {{\"intVal\": 7}}]");
423
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, true, [1, 2, 3]]");
437
DotNetDispatcher
.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, true, null]");
458
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, "InvokableInstanceMethod", 1, default), argsJson);
477
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, nameof(GenericType<int>.EchoStringParameter), 1, default), argsJson);
493
var resultJson =
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, nameof(GenericType<string>.EchoParameter), 1, default), argsJson);
506
var ex = Assert.Throws<ArgumentException>(() =>
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, methodIdentifier, 0, default), "[7]"));
521
var ex = Assert.Throws<ArgumentException>(() =>
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, methodIdentifier, 1, default), argsJson));
536
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(null, nameof(GenericType<int>.EchoParameter), 1, default), argsJson));
553
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, "InvocableStaticWithParams", default, default), argsJson);
576
DotNetDispatcher
.Invoke(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, "InvocableStaticWithParams", default, default), argsJson);
603
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(null, "InvokableAsyncMethod", 1, callId), argsJson);
642
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(null,
666
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(null,
684
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, nameof(ThrowingClass.ThrowingMethod), default, callId), default);
706
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, nameof(ThrowingClass.AsyncThrowingMethod), default, callId), default);
726
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(thisAssemblyName, "InvocableStaticWithParams", default, callId), "<xml>not json</xml>");
744
DotNetDispatcher
.BeginInvokeDotNet(jsRuntime, new DotNetInvocationInfo(null, "InvokableInstanceVoid", 1, callId), null);
758
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) }));
767
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) }));
776
Assert.ThrowsAny<JsonException>(() =>
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) }));
786
var result =
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string), typeof(int), });
799
var result =
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(TestDTO), });
814
var result =
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(int), typeof(TestDTO), });
831
var ex = Assert.Throws<InvalidOperationException>(() =>
DotNetDispatcher
.ParseArguments(new TestJSRuntime(), method, arguments, new[] { typeof(int), typeof(TestDTO), }));
845
DotNetDispatcher
.ReceiveByteArray(jsRuntime, 0, byteArray);