protected internal StorageBase(IJSRuntime jsRuntime) { if (jsRuntime is IJSInProcessRuntime rt) { _jsRuntime = new ClientSideJsRuntimeAccess(rt); } else { _jsRuntime = new ServerSideJsRuntimeAccess(jsRuntime); } _fullTypeName = GetType().FullName.Replace('.', '_'); }
protected internal StorageBase(IJSRuntime jsRuntime) { if (jsRuntime is IJSInProcessRuntime rt) { _jsRuntime = new ClientSideJsRuntimeAccess(rt); } else { _jsRuntime = new ServerSideJsRuntimeAccess(jsRuntime); } _fullTypeName = GetType().FullName.Replace('.', '_'); _jsRuntime.JsRuntimeInvokeAsync <object>( $"{_fullTypeName}.AddEventListener", DotNetObjectReference.Create(this) ); }
public static ValueTask <T> JsRuntimeInvokeAsync <T>(this IJsRuntimeAccess jsRuntime, string identifier, params object[] args) { return(jsRuntime.InvokeAsync <T>(identifier, args)); }
public static ValueTask <T> JsRuntimeInvokeAsync <T>(this IJsRuntimeAccess jsRuntime, string identifier, IEnumerable <object> args, CancellationToken cancellationToken = default) { return(jsRuntime.InvokeAsync <T>(identifier, args, cancellationToken)); }
public static T JsRuntimeInvoke <T>(this IJsRuntimeAccess jsRuntime, string identifier, params object[] args) { return(jsRuntime.Invoke <T>(identifier, args)); }