public async ValueTask <string?> GetCookieAsync(string name) { _ = name ?? throw new ArgumentNullException(nameof(name)); var module = await _jsRuntime .ImportOrGetModuleAsync(ModulePath, ModuleKey, _jsRefStore); return(await module.InvokeAsync <string>( "getCookie", name)); }
/// <inheritdoc/> public async ValueTask <bool> WriteAsync(string?value) { if (string.IsNullOrEmpty(value)) { return(false); } var module = await _jsRuntime .ImportOrGetModuleAsync(ModulePath, ModuleKey, _jsRefStore); return(await module !.InvokeAsync <bool>( "writeText", value)); }
public async Task AddEventHandlerAsync <TArgument>(string eventName, Action <TArgument?> handler) where TArgument : EventArgs { var module = await _jsRuntime .ImportOrGetModuleAsync(WindowService.ModulePath, WindowService.ModuleKey, _jsRefStore); if (AddEventHandlerInternal(eventName, handler)) { // Add inital event-handler for the given event await module.InvokeVoidAsync( "addEventHandler", eventName, nameof(HandleEventCallback), DotNetObjectReference.Create(this)); } }
public async ValueTask SetTitleAsync(string?value) { var module = await _jsRuntime .ImportOrGetModuleAsync(ModulePath, ModuleKey, _jsRefStore); await module.InvokeVoidAsync( "setTitle", value); }
public async ValueTask OpenAsync(string?url, string?windowName) { var module = await _jsRuntime .ImportOrGetModuleAsync(ModulePath, ModuleKey, _jsRefStore); await module.InvokeVoidAsync( "open", url, windowName); }
public async ValueTask <bool> InsertMarkupAsync(string parentSelector, string?value, InsertionPosition position, MarkupType type) { _ = parentSelector ?? throw new ArgumentNullException(nameof(parentSelector)); var module = await _jsRuntime .ImportOrGetModuleAsync(ModulePath, ModuleKey, _jsRefStore); return(await module.InvokeAsync <bool>( "insertMarkup", parentSelector, value, MapInsertionPosition(position), MapMarkupType(type))); }