Skip to content

Commit

Permalink
Cleanup code & use readonly variables instead of getters in Resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Jun 19, 2024
1 parent a8a9493 commit 6b04b74
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/BedrockUpdater.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WInExe</OutputType>
<OutputType>WinExe</OutputType>
<TargetFramework>net481</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
Expand All @@ -12,7 +12,7 @@
<ApplicationManifest>Resources/.manifest</ApplicationManifest>
<ApplicationIcon>Resources/.ico</ApplicationIcon>

<AssemblyVersion>1.1.2.0</AssemblyVersion>
<AssemblyVersion>1.1.3.0</AssemblyVersion>
<AssemblyTitle>Bedrock Updater</AssemblyTitle>
<Product>Bedrock Updater</Product>
<Copyright>Copyright (C) 2024</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion src/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ internal MainWindow(IEnumerable<string> args)
Store.PackageManager.RemovePackageAsync(package.Id.FullName).GetResults();
};

ContentRendered += async (sender, e) => await Task.Run(() =>
ContentRendered += (sender, e) => Task.Run(() =>
{
Store store = new();
var preview = args.FirstOrDefault()?.Equals("/preview", StringComparison.OrdinalIgnoreCase) ?? false;
Expand Down
2 changes: 0 additions & 2 deletions src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Runtime.InteropServices;
using System.Windows;
using System;
using System.Threading.Tasks;
using System.Linq;

static class Program
{
Expand Down
10 changes: 5 additions & 5 deletions src/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ static class Resources
{
static readonly Assembly assembly = Assembly.GetExecutingAssembly();

internal static string GetCookie => ToString("GetCookie.xml");
internal static readonly string GetCookie = ToString("GetCookie.xml");

internal static string GetExtendedUpdateInfo2 => ToString("GetExtendedUpdateInfo2.xml");
internal static readonly string GetExtendedUpdateInfo2 = ToString("GetExtendedUpdateInfo2.xml");

internal static string SyncUpdates => ToString("SyncUpdates.xml");
internal static readonly string SyncUpdates = ToString("SyncUpdates.xml");

internal static string Minecraft => ToString("Minecraft.svg");
internal static readonly string Minecraft = ToString("Minecraft.svg");

internal static ImageSource Icon => ToImageSource(".ico");
internal static readonly ImageSource Icon = ToImageSource(".ico");

static ImageSource ToImageSource(string name)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Store.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class Store

internal Store() { syncUpdates = Resources.SyncUpdates.Replace("{1}", Post(Resources.GetCookie).GetElementsByTagName("EncryptedData")[0].InnerText); }

~Store() { webClient.Dispose(); }

internal IEnumerable<IProduct> GetProducts(params string[] productIds)
{
List<IProduct> products = [];
Expand Down

0 comments on commit 6b04b74

Please sign in to comment.