Class SymbolSet
- Namespace
- EncDotNet.S100.Portrayals.Application
- Assembly
- EncDotNet.S100.Portrayals.dll
The S-100 SVG symbols of a portrayal defined in code, read from embedded resources and served by name through Provider.
public sealed class SymbolSet
- Inheritance
-
SymbolSet
- Inherited Members
Remarks
Each .svg resource whose manifest name starts with the resource
prefix is one symbol, named by the rest of the resource name without the
extension: EncDotNet.S100.Datasets.S104.Symbols.S104GAUGE_RISING.svg
under the prefix EncDotNet.S100.Datasets.S104.Symbols is the symbol
S104GAUGE_RISING. Embed them with an explicit LogicalName so
the names don't depend on the project's root namespace:
<EmbeddedResource Include="Symbols\*.svg"
LogicalName="My.Product.Symbols.%(Filename)%(Extension)" />
The symbols follow the S-100 Part 9 SVG conventions, so the renderers
treat them like catalogue symbols: the pivot point at the origin, sizes in
millimetres, and colours as palette classes (fTOKEN fill,
sTOKEN stroke) resolved against the portrayal's
ApplicationPalette. A symbol is read once, on first use.
Constructors
SymbolSet(Assembly, string)
Creates a symbol set from assembly's embedded SVG resources.
public SymbolSet(Assembly assembly, string resourcePrefix)
Parameters
assemblyAssemblyThe assembly holding the resources.
resourcePrefixstringThe manifest resource name prefix, with or without the trailing
., e.g."EncDotNet.S100.Datasets.S104.Symbols".
Exceptions
- ArgumentException
No SVG resource has the prefix.
Properties
Names
The symbol names.
public IReadOnlyCollection<string> Names { get; }
Property Value
Provider
Resolves a symbol name to its SVG, or null for a name the set doesn't hold. Pass it as a sub-layer's symbol provider. It is the same delegate on every call.
public Func<string, string?> Provider { get; }
Property Value
Methods
Contains(string)
Whether the set holds the symbol name.
public bool Contains(string name)
Parameters
namestringThe symbol name.
Returns
GetSymbol(string)
The SVG of the symbol name, or null
for a name the set doesn't hold.
public string? GetSymbol(string name)
Parameters
namestringThe symbol name, matched ordinally.