API Reference
LibraryDownloader
Support class to help building HtmlForgeX without the manual effort of maintaining CSS and JS files locally. It downloads the external resources referenced by available libraries.
Inheritance
- Object
- LibraryDownloader
Constructors
public LibraryDownloader() #Initializes a new instance of the LibraryDownloader class using the default HTTP fetch behavior.
LibraryDownloader(System.Net.Http.HttpClient arg1) #Internal constructor for injecting custom HTTP clients.
Parameters
- arg1 System.Net.Http.HttpClient
LibraryDownloader(System.Func{System.String,System.String,System.String,System.Threading.Tasks.Task} arg1) #Internal for tests: inject a custom fetch delegate (url, mappedPath, root).
Parameters
- arg1 System.Func{System.String,System.String,System.String,System.Threading.Tasks.Task}
Methods
DefaultFetchAsync(System.String arg1, System.String arg2, System.String arg3) #Default HTTP fetcher: downloads URL and saves either to a mapped relative path or to the file name derived from the URL.
Parameters
- arg1 System.String
- arg2 System.String
- arg3 System.String
DownloadFileAsync(System.String rootPath, System.String url) #Downloads the file from the URL.
Parameters
- rootPath System.String
- The root path.
- url System.String
- The URL.
Exceptions
ArgumentException– Unsupported file type: {fileName}
DownloadFileMappedAsync(System.String arg1, System.String arg2, System.String arg3) #Downloads a file from URL but saves it using an explicit local relative path (e.g., "Scripts/my.js").
Parameters
- arg1 System.String
- arg2 System.String
- arg3 System.String
public async Task DownloadLibraryAsync(String rootPath) #TaskDownloads all CSS and JS files for all libraries into given folder for easy inclusion in project
Parameters
- rootPath System.String
- The root path.
public async Task DownloadLibraryAsync(String path, Libraries libraryEnum) #TaskDownloads specific library CSS and JS files into given folder for easy inclusion in project
Parameters
- path System.String
- The path.
- libraryEnum HtmlForgeX.Libraries
- The library enum.
public async Task<List<String>> GenerateTablerIconCodeAsync(String cssFilePath) #Task<List<String>>Generates the tabler icon code so it can be easily copied to the TablerIconLibrary class.
Parameters
- cssFilePath System.String
- The CSS file path.
NumberToWord(System.String input) #Numbers to word to help with pascal case conversion.
Parameters
- input System.String
- The input.
ToPascalCase(System.String input) #Converts to pascalcase so icon names can be used as properties.
Parameters
- input System.String
- The input.
Inherited Methods
Properties
public Boolean StripSourceMapComments { get; set; } #When true, removes sourceMappingURL comments from downloaded JS/CSS files. Useful for CDN mirrors that should not reference upstream source maps.