Version 3.0.342

This commit is contained in:
Oliver Hauff 2022-10-03 17:55:10 +02:00
parent d852ccef4c
commit 2cde196f16
54 changed files with 998 additions and 498 deletions

View file

@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Reflection;
using System.Text;
using Serilog;
@ -27,16 +27,16 @@ namespace TINK.ViewModel
/// <summary> Gets an an embedded html ressource.</summary>
/// <param name="resrouceName">Name of resource to get.</param>
/// <returns></returns>
public static string GetSource(string resrouceName)
public static string GetEmbeddedResource(string resrouceName)
{
var l_oRessourceName = RessourcePrefix + resrouceName;
var ressourceName = RessourcePrefix + resrouceName;
Log.Verbose($"Using this resource prefix {RessourcePrefix}.");
// note that the prefix includes the trailing period '.' that is required
var assembly = typeof(ViewModelResourceHelper).GetTypeInfo().Assembly;
var stream = assembly.GetManifestResourceStream(l_oRessourceName);
var stream = assembly.GetManifestResourceStream(ressourceName);
return stream != null
? (new StreamReader(stream, Encoding.UTF8)).ReadToEnd()
: string.Format("<!DOCTYPE html><html lang=\"de\"><body>An error occurred loading html- ressource {0}.</body>", l_oRessourceName);
: string.Format("<!DOCTYPE html><html lang=\"de\"><body>An error occurred loading html- ressource {0}.</body>", ressourceName);
}
}
}