Skip to content

Commit b44662e

Browse files
committed
Load variables on demand.
1 parent 49ee9c6 commit b44662e

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

src/MainWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal MainWindow(bool preview)
3737
Child = new System.Windows.Forms.WebBrowser
3838
{
3939
ScrollBarsEnabled = false,
40-
DocumentText = $@"<!DOCTYPE html><html><head><meta http-equiv=""X-UA-Compatible"" content=""IE=edge""></head><body style=""background-color:#1E1E1E""><div style=""width:100%;height:100%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)"">{(global::Resources.Logo)}</div></body></html>"
40+
DocumentText = $@"<!DOCTYPE html><html><head><meta http-equiv=""X-UA-Compatible"" content=""IE=edge""></head><body style=""background-color:#1E1E1E""><div style=""width:100%;height:100%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)"">{(global::Resources.ToString("Logo.svg"))}</div></body></html>"
4141
},
4242
IsEnabled = false
4343
};
@@ -88,7 +88,7 @@ internal MainWindow(bool preview)
8888
Grid.SetRow(textBlock2, 0);
8989
grid.Children.Add(textBlock2);
9090

91-
using WebClient client = new() ;
91+
using WebClient client = new();
9292
string value = default;
9393

9494
client.DownloadProgressChanged += (sender, e) =>

src/Resources.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,17 @@ static class Resources
77
{
88
static readonly Assembly assembly = Assembly.GetExecutingAssembly();
99

10-
internal static readonly string GetCookie = ToString("GetCookie.xml");
11-
1210
internal static readonly string GetExtendedUpdateInfo2 = ToString("GetExtendedUpdateInfo2.xml");
1311

14-
internal static readonly string SyncUpdates = ToString("SyncUpdates.xml");
15-
16-
internal static readonly string Logo = ToString("Logo.svg");
17-
1812
internal static readonly ImageSource Icon = ToImageSource(".ico");
1913

20-
static ImageSource ToImageSource(string name)
14+
internal static ImageSource ToImageSource(string name)
2115
{
2216
using var stream = assembly.GetManifestResourceStream(name);
2317
return BitmapFrame.Create(stream);
2418
}
2519

26-
static string ToString(string name)
20+
internal static string ToString(string name)
2721
{
2822
using var stream = assembly.GetManifestResourceStream(name);
2923
using StreamReader reader = new(stream);

src/Store.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ internal static string GetUrl(IUpdate update)
7373
internal static ReadOnlyCollection<IUpdate> GetUpdates(IProduct product)
7474
{
7575
var result = (XmlElement)UploadString(
76-
(data ??= Resources.SyncUpdates.Replace("{1}", UploadString(Resources.GetCookie).GetElementsByTagName("EncryptedData")[0].InnerText))
76+
(data ??= Resources.ToString("SyncUpdates.xml").Replace("{1}", UploadString(Resources.ToString("GetCookie.xml")).GetElementsByTagName("EncryptedData")[0].InnerText))
7777
.Replace("{2}", product.AppCategoryId))
7878
.GetElementsByTagName("SyncUpdatesResult")[0];
7979

0 commit comments

Comments
 (0)