Cache when reading embedded resources

This commit is contained in:
2dust
2025-01-31 16:02:29 +08:00
parent 331d11aee2
commit 4faa94b2a3
10 changed files with 94 additions and 83 deletions
@@ -31,14 +31,14 @@ namespace ServiceLib.ViewModels
ImportDefConfig4V2rayCmd = ReactiveCommand.CreateFromTask(async () =>
{
normalDNS = Utils.GetEmbedText(Global.DNSV2rayNormalFileName);
normalDNS = EmbedUtils.GetEmbedText(Global.DNSV2rayNormalFileName);
await Task.CompletedTask;
});
ImportDefConfig4SingboxCmd = ReactiveCommand.CreateFromTask(async () =>
{
normalDNS2 = Utils.GetEmbedText(Global.DNSSingboxNormalFileName);
tunDNS2 = Utils.GetEmbedText(Global.TunSingboxDNSFileName);
normalDNS2 = EmbedUtils.GetEmbedText(Global.DNSSingboxNormalFileName);
tunDNS2 = EmbedUtils.GetEmbedText(Global.TunSingboxDNSFileName);
await Task.CompletedTask;
});
@@ -257,7 +257,7 @@ namespace ServiceLib.ViewModels
return;
}
var result = Utils.LoadResource(fileName);
var result = EmbedUtils.LoadResource(fileName);
if (Utils.IsNullOrEmpty(result))
{
return;