mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.342
This commit is contained in:
parent
d852ccef4c
commit
2cde196f16
54 changed files with 998 additions and 498 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue