Table of Contents

Method FromUrlOrNull

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

FromUrlOrNull(string)

Initializes a new instance of the IconSet class from the specified url.

public static IconSet? FromUrlOrNull(string url)

Parameters

url string

The file or embedded resource url used to load the image.

Returns

IconSet

Examples

var ResPrefix = $"embres:ControlsTest.Resources.Icons.";
var url = $"{ResPrefix}default.ico";
var iconSet = IconSet.FromUrl(url); // can raise an exception if file not found
var iconSet2 = IconSet.FromUrlOrNull(url); // return null instead of exception
if file not found

Remarks

url can include assembly name. Example: "embres:Alternet.UI.Resources.Svg.IconName.ico?assembly=Alternet.UI"