now!!
This commit is contained in:
18
Pilz.UI.Telerik.Symbols/Factories/BasicFactory.cs
Normal file
18
Pilz.UI.Telerik.Symbols/Factories/BasicFactory.cs
Normal 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";
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.0.7</Version>
|
||||
<Version>1.0.8</Version>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user