Show / Hide Table of Contents

Method ScriptEditor.GetIcon


Overload

Gets icon string in specified format.

public static string GetIcon(string file, EGetIcon what)
Parameters
file  (string)

Script file/folder path etc, or icon name. See EGetIcon, ImageUtil.LoadWpfImageElement.

what  (EGetIcon)

The format of input and output strings.

Returns
string

Returns null if editor isn't running or if the file does not exist. Read more in Remarks.

Remarks

If what is EGetIcon.IconNameToXaml, this function tries to get icon XAML from assembly resources (passes file to ResourceUtil.GetString, with color removed); if not found - from editor. By default the LibreAutomate compiler finds literal icon-like strings in code and adds icon XAML to assembly resources; see Properties > Resource > Options.