Table of Contents

Class ResourceLoader

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Loads resources compiled into the application binary.

public class ResourceLoader
Inheritance
ResourceLoader

Constructors

ResourceLoader(Assembly?)

Initializes a new instance of the ResourceLoader class.

Properties

Default

Gets or sets default ResourceLoader.

Methods

DefaultStreamFromUri(Uri, Uri?)

Default implementation of the open stream from the Uri. Used in DefaultStreamFromUrl(string, Uri?).

DefaultStreamFromUrl(string, Uri?)

Default implementation of StreamFromUrl(string, Uri?). See StreamFromUrl(string, Uri?) for details.

Exists(Uri, Uri?)

Checks if an asset with the specified URI exists.

ExtractResourceSafe(string, string)

Extracts a resource from the specified URL and saves it to the given destination path. Returns true if the operation succeeds, otherwise false.

ExtractResourcesSafe(string, string[], string)

Extracts multiple resources from the specified URL and saves them to the given destination folder. Returns true if all operations succeed, otherwise false.

GetAsset(Uri, Uri?)

Retrieves the asset descriptor for the specified URI.

GetAssets(Uri, Uri?)

Gets all assets of a folder and subfolders that match specified uri.

Open(Uri, Uri?)

Opens the asset with the requested URI.

OpenAndGetAssembly(Uri, Uri?)

Opens the asset with the requested URI and returns the asset stream and the assembly containing the asset.

SetDefaultAssembly(Assembly)

Sets the default assembly from which to load assets for which no assembly is specified.

StreamFromUrl(string, Uri?)

Loads Stream from the specified url.

StreamFromUrlOr(string?, Uri?, Func<Stream?>?)

Attempts to load a Stream from the specified URL or uses a fallback function if provided.

StreamFromUrlOrDefault(string?, Func<Stream?>?)

Calls StreamFromUrlOrDefault(string?, Func<Stream?>?) and if it returns null, calls func.

StringFromUrlOrNull(string, Encoding?)

Loads a string from the specified resource URL or returns null if failed.

Events

CustomStreamFromUrl

Occurs when StreamFromUrl(string, Uri?) is called. You can implement CustomStreamFromUrl event handler in order to perform custom url processing.