feat(CustomImages): Implementiert anstelle von Bildern, um mehrere Bilder über ein Wörterbuch zu konfigurieren

This commit is contained in:
Developer 02
2025-02-13 00:48:47 +01:00
parent 1e34042f77
commit 41b5b62f2c
9 changed files with 32 additions and 25 deletions

View File

@@ -0,0 +1,6 @@
namespace EnvelopeGenerator.Web.Models;
public class CustomImages : Dictionary<string, Image>
{
public new Image this[string key] => TryGetValue(key, out var img) && img is not null ? img : new();
}

View File

@@ -0,0 +1,10 @@
namespace EnvelopeGenerator.Web.Models;
public class Image
{
public string Src { get; init; } = string.Empty;
public Dictionary<string, string> Classes { get; init; } = new();
public string GetClassIn(string page) => Classes.TryGetValue(page, out var cls) && cls is not null ? cls : string.Empty;
}

View File

@@ -1,11 +0,0 @@
namespace EnvelopeGenerator.Web.Models
{
public class Img
{
public string Src { get; init; } = string.Empty;
public Dictionary<string, string> Classes { get; init; } = new();
public string ClassIn(string page) => Classes.TryGetValue(page, out var cls) && cls is not null ? cls : string.Empty;
}
}