Method StreamFromUrlOr
StreamFromUrlOr(string?, Uri?, Func<Stream?>?)
Attempts to load a Stream from the specified URL or uses a fallback function if provided.
public static Stream? StreamFromUrlOr(string? url, Uri? baseUri, Func<Stream?>? func = null)
Parameters
url
stringThe URL used to load the data. By default, "file" and "embres" protocols are supported, but this can be extended using the CustomStreamFromUrl event.
baseUri
UriSpecifies the base URL if
url
is not absolute.func
Func<Stream>A fallback function to invoke if the default loading mechanism fails.