Skip to content

Commit

Permalink
Don't use discard.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Oct 11, 2024
1 parent 2e99367 commit dce600f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BedrockUpdater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PublishRelease>true</PublishRelease>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CS8500</NoWarn>
<NoWarn>CS8500,CS4014</NoWarn>

<ApplicationManifest>Resources/.manifest</ApplicationManifest>
<ApplicationIcon>Resources/.ico</ApplicationIcon>
Expand Down
8 changes: 4 additions & 4 deletions src/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sealed class MainWindow : Window
[DllImport("Shell32", CharSet = CharSet.Auto, SetLastError = true), DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
static extern int ShellMessageBox(nint hAppInst = default, nint hWnd = default, string lpcText = default, string lpcTitle = "Bedrock Updater", int fuStyle = 0x00000010);

public MainWindow(bool preview)
public MainWindow(bool _)
{
Icon = global::Resources.Get<ImageSource>(".ico");
UseLayoutRounding = true;
Expand All @@ -23,7 +23,7 @@ public MainWindow(bool preview)
WindowStartupLocation = WindowStartupLocation.CenterScreen;
SizeToContent = SizeToContent.WidthAndHeight;
Background = new SolidColorBrush(Color.FromRgb(30, 30, 30));
var text = preview ? "Updating Preview..." : "Updating Release...";
var text = _ ? "Updating Preview..." : "Updating Release...";

Canvas canvas = new() { Width = 381, Height = 115 }; Content = canvas;

Expand All @@ -49,7 +49,7 @@ public MainWindow(bool preview)
Application.Current.Exit += (_, _) =>
{
if (operation is not null) { operation.Cancel(); SpinWait.SpinUntil(() => operation.Status != AsyncStatus.Started); }
foreach (var package in Store.PackageManager.FindPackagesForUserWithPackageTypes(string.Empty, PackageTypes.Framework)) _ = Store.PackageManager.RemovePackageAsync(package.Id.FullName);
foreach (var package in Store.PackageManager.FindPackagesForUserWithPackageTypes(string.Empty, PackageTypes.Framework)) Store.PackageManager.RemovePackageAsync(package.Id.FullName);
};

Application.Current.Dispatcher.UnhandledException += (_, e) =>
Expand All @@ -67,7 +67,7 @@ public MainWindow(bool preview)
{
if (bar.Value != _.percentage && _.state == DeploymentProgressState.Processing) { if (bar.IsIndeterminate) bar.IsIndeterminate = false; block2.Text = $"Preparing... {bar.Value = _.percentage}%"; }
}));
foreach (var array in Store.Get("9WZDNCRD1HKW", preview ? "9P5X4QVLC2XR" : "9NBLGGH2JHXJ"))
foreach (var array in Store.Get("9WZDNCRD1HKW", _ ? "9P5X4QVLC2XR" : "9NBLGGH2JHXJ"))
{
for (int index = 0; index < array.Length; index++)
{
Expand Down

0 comments on commit dce600f

Please sign in to comment.