PlotDirector/PlotLine/Services/LocationWorkspaceIcons.cs

19 lines
875 B
C#

using PlotLine.Models;
namespace PlotLine.Services;
// Canonical metadata supplies icon keys/tones. The shared library supplies SVG geometry.
public static class LocationWorkspaceIcons
{
public static object Presentation(string value, string name, string icon = "locations", string tone = "secondary")
=> CharacterQuickAttributes.Presentation(new(value, name, icon, tone));
public static object Presentation(LocationTypeTaxonomyEntry entry)
{
var icon = ApplicationRibbon.Icon(entry.IconKey);
return new { key = entry.TypeKey, parentKey = entry.ParentKey,
value = entry.IsAssignable ? entry.LocationTypeID?.ToString() ?? "" : "@" + entry.TypeKey,
label = entry.DisplayName, assignable = entry.IsAssignable,
icon = entry.IconKey, tone = entry.SemanticTone, path = icon.IconPath, icon.Filled };
}
}