Skip to content

Class DocumentLoader

Definition

Namespace: StardewUI.Framework.Dom
Assembly: StardewUI.dll

Utility for loading Documents from memory or files.

public static class DocumentLoader

Inheritance
Object ⇦ DocumentLoader

Members

Methods

Name Description
LoadFromFile(FileInfo) Loads a Document from markup in a file.
TryLoadFromFileAsync(FileInfo) Loads a Document from markup in a file using asynchronous I/O.

Details

Methods

LoadFromFile(FileInfo)

Loads a Document from markup in a file.

public static StardewUI.Framework.Dom.Document LoadFromFile(System.IO.FileInfo file);
Parameters

file   FileInfo
The file containing the document markup.

Returns

Document

The parsed Document.

Remarks

This method is designed to be called from SMAPI's content loader, and throws exceptions normally associated with SMAPI's content pipeline.


TryLoadFromFileAsync(FileInfo)

Loads a Document from markup in a file using asynchronous I/O.

public static System.Threading.Tasks.Task<StardewUI.Framework.Dom.Document> TryLoadFromFileAsync(System.IO.FileInfo file);
Parameters

file   FileInfo
The file containing the document markup.

Returns

Task<Document>

The parsed Document, or null if the file does not exist or the markup contained in the file is invalid.