public static class AssetSourceExtensions Views of an IAssetSource.
Methods
Subdirectory
public static IAssetSource Subdirectory(this IAssetSource source, string path, string entryPoint = "index.html") Presents one folder of source as a frontend of its own: its assets keep their content and metadata under paths relative to the folder, and entryPoint in the folder is the entry point.
Parameters
sourceThe source, such as an
AssetArchiveSourcethat holds several frontends.pathThe folder, relative to the source, such as
settingsorwindows/settings/.entryPointThe entry document, relative to the folder;
index.htmlby default.
Returns
A source that serves the folder's assets at its root.
Exceptions
ArgumentNullExceptionAn argument is
null.ArgumentExceptionpathorentryPointis not a safe relative asset path (AssetPath.Normalize).DirectoryNotFoundExceptionNo asset of
sourceis in the folder.FileNotFoundExceptionThe folder has no
entryPoint.
Remarks
The view takes the folder's assets from the manifest source has when it is created, and opens them through source. Create a new view after a live source, such as a DevelopmentDirectoryAssetSource, changes: an asset whose content changed since then fails to open with InvalidDataException. IAssetSource.ValidateAsync verifies the folder's assets only. Every host adapter serves the view as it serves any source, for example RunicDesktopHostOptions.Assets = archive.Subdirectory("settings").