示例#1
0
        // Supports E2E tests in StartupErrorNotificationTest
        private static async Task SimulateErrorsIfNeededForTest()
        {
            var currentUrl = new MonoWebAssemblyJSRuntime().Invoke <string>("getCurrentUrl");

            if (currentUrl.Contains("error=sync"))
            {
                throw new InvalidTimeZoneException("This is a synchronous startup exception");
            }

            await Task.Yield();

            if (currentUrl.Contains("error=async"))
            {
                throw new InvalidTimeZoneException("This is an asynchronous startup exception");
            }
        }
示例#2
0
 public ExtendedJSRuntimeWrapper(IJSRuntime current)
 {
     this.current = current as MonoWebAssemblyJSRuntime
                    ?? throw new PlatformNotSupportedException($"Requires {nameof(MonoWebAssemblyJSRuntime)} as the JSRuntime");
 }
 public static void DownloadFile(this MonoWebAssemblyJSRuntime js, string fileName, byte[] Data) =>
 js.InvokeUnmarshalled <string, byte[], object>("DownloadBlob", fileName, Data);