Iconify Class
Provides access to Iconify icons.
public static class IconifyRemarks
The icon sets declared with IconifyIconSet items in the project file are generated at build time and exposed as static extension properties of this class, such as Iconify.Mdi.Icons.Home.
The Load methods read any icon set in the IconifyJSON format at run time, such as the files of the iconify/icon-sets repository.
Methods
| Name | Description |
|---|---|
| Load(Stream) | Loads an icon set in the IconifyJSON format from a stream. |
| Load(string) | Loads an icon set in the IconifyJSON format from a file. |
| LoadAsync(Stream, CancellationToken) | Loads an icon set in the IconifyJSON format from a stream. |
| LoadAsync(string, CancellationToken) | Loads an icon set in the IconifyJSON format from a file. |
| Parse(string) | Parses an icon set in the IconifyJSON format. |
Load overloads
Load(Stream)
Iconify.csLoads an icon set in the IconifyJSON format from a stream.
public static IconifyIconSet Load(Stream stream)Parameters
streamStream- The stream that contains the JSON document, encoded in UTF-8. It is read to the end, but not closed.
Returns
IconifyIconSet The icon set, with its aliases resolved.
Exceptions
FormatException- The stream does not contain a valid icon set.
Load(string)
Iconify.csLoads an icon set in the IconifyJSON format from a file.
public static IconifyIconSet Load(string path)Parameters
pathstring- The path of the JSON file.
Returns
IconifyIconSet The icon set, with its aliases resolved.
Exceptions
FormatException- The file is not a valid icon set.
LoadAsync overloads
LoadAsync(Stream, CancellationToken)
Iconify.csLoads an icon set in the IconifyJSON format from a stream.
net10.0
public static Task<IconifyIconSet> LoadAsync(Stream stream, CancellationToken cancellationToken = default)net11.0
public static Task<IconifyIconSet> LoadAsync(Stream stream, CancellationToken cancellationToken = default)Parameters
streamStream- The stream that contains the JSON document, encoded in UTF-8. It is read to the end, but not closed.
cancellationTokenCancellationToken- The token to monitor for cancellation requests.
Returns
Task<IconifyIconSet> The icon set, with its aliases resolved.
Exceptions
FormatException- The stream does not contain a valid icon set.
LoadAsync(string, CancellationToken)
Iconify.csLoads an icon set in the IconifyJSON format from a file.
net10.0
public static Task<IconifyIconSet> LoadAsync(string path, CancellationToken cancellationToken = default)net11.0
public static Task<IconifyIconSet> LoadAsync(string path, CancellationToken cancellationToken = default)Parameters
pathstring- The path of the JSON file.
cancellationTokenCancellationToken- The token to monitor for cancellation requests.
Returns
Task<IconifyIconSet> The icon set, with its aliases resolved.
Exceptions
FormatException- The file is not a valid icon set.
Parse(string)
Iconify.csParses an icon set in the IconifyJSON format.
public static IconifyIconSet Parse(string json)Parameters
jsonstring- The JSON document.
Returns
IconifyIconSet The icon set, with its aliases resolved.
Exceptions
FormatException- The text is not a valid icon set.