This commit is contained in:
Pilzinsel64
2025-06-04 12:54:31 +02:00
parent de592ee65b
commit 815da2b24c
5 changed files with 21 additions and 41 deletions

View File

@@ -0,0 +1,18 @@
using System.Reflection;
namespace Pilz.UI.Telerik.Symbols.Factories;
public class BasicFactory<T>(string baseName) : RadSymbolFactory<T> where T : Enum
{
private Assembly? assembly;
public override Assembly GetImageResourceAssembly()
{
return assembly ??= Assembly.Load(baseName);
}
public override string GetImageRessourcePath(T svgImage)
{
return $"{baseName}.Files.{svgImage}.svg";
}
}

View File

@@ -1,19 +0,0 @@
using Pilz.UI.Telerik.Symbols.Sets;
using System.Reflection;
namespace Pilz.UI.Telerik.Symbols.Factories;
internal class ColorFactory : RadSymbolFactory<SymbolsColor>
{
private Assembly? assembly;
public override Assembly GetImageResourceAssembly()
{
return assembly ??= Assembly.Load("Pilz.SymbolPacks.Color");
}
public override string GetImageRessourcePath(SymbolsColor svgImage)
{
return $"Pilz.SymbolPacks.Color.Files.{svgImage}.svg";
}
}

View File

@@ -1,19 +0,0 @@
using Pilz.UI.Telerik.Symbols.Sets;
using System.Reflection;
namespace Pilz.UI.Telerik.Symbols.Factories;
internal class FluentFactory : RadSymbolFactory<SymbolsFluent>
{
private Assembly? assembly;
public override Assembly GetImageResourceAssembly()
{
return assembly ??= Assembly.Load("Pilz.SymbolPacks.Fluent");
}
public override string GetImageRessourcePath(SymbolsFluent svgImage)
{
return $"Pilz.SymbolPacks.Fluent.Files.{svgImage}.svg";
}
}

View File

@@ -8,7 +8,7 @@
</PropertyGroup>
<PropertyGroup>
<Version>1.0.7</Version>
<Version>1.0.8</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

View File

@@ -8,6 +8,6 @@ public static class RadSymbols
private static IRadSymbolFactory<SymbolsColor>? color;
private static IRadSymbolFactory<SymbolsFluent>? fluent;
public static IRadSymbolFactory<SymbolsColor> Color => color ??= new ColorFactory();
public static IRadSymbolFactory<SymbolsFluent> Fluent => fluent ??= new FluentFactory();
public static IRadSymbolFactory<SymbolsColor> Color => color ??= new BasicFactory<SymbolsColor>("Pilz.SymbolPacks.Color");
public static IRadSymbolFactory<SymbolsFluent> Fluent => fluent ??= new BasicFactory<SymbolsFluent>("Pilz.SymbolPacks.Fluent");
}