Skip to content

Commit

Permalink
Fixed: Resolved some compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Aug 9, 2022
1 parent 033a5aa commit df925d3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public ApplicationPage()
SwappedOut += Dispose;
InitializeComponent();
ViewModel = new ApplicationViewModel(Lib.IoC.Get<MainPageViewModel>().SelectedApplication!, Lib.IoC.Get<ModConfigService>(), Lib.IoC.Get<ModUserConfigService>(), Lib.IoC.Get<LoaderConfig>());
ViewModel.PropertyChanged += OnPageChanged;
ViewModel.PropertyChanged += WhenPageChanged;
ViewModel.ChangeApplicationPage(ApplicationSubPage.ApplicationSummary);
}

private void OnPageChanged(object? sender, PropertyChangedEventArgs e)
private void WhenPageChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(ViewModel.Page))
SwitchPage(ViewModel.Page);
Expand All @@ -39,7 +39,7 @@ public void Dispose()
return;

_disposed = true;
ViewModel.PropertyChanged -= OnPageChanged;
ViewModel.PropertyChanged -= WhenPageChanged;
ActionWrappers.ExecuteWithApplicationDispatcherAsync(() =>
{
if (PageHost.CurrentPage is IDisposable disposable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public PackagePreviewPage(DownloadPackagePreviewViewModel viewModel, Action clos
_close = close;
InitializeComponent();
this.AnimateInFinished -= OnAnimateInFinished;
PreviewCarousel.OnPageIndexChanged += OnPageIndexChanged;
PreviewCarousel.OnPageIndexChanged += WhenPageIndexChanged;
ControllerSupport.SubscribePreviewCustomInputs(SubscribePreviewCustomInputs);

// We need to explicitly set focus in case person changes page on controller without
Expand Down Expand Up @@ -211,7 +211,7 @@ protected override Animation[] MakeExitAnimations()
// Don't navigate hyperlinks in our markdown, thanks!
private void Page_Click(object sender, RoutedEventArgs e) => e.Handled = true;

private void OnPageIndexChanged(int pageIndex)
private void WhenPageIndexChanged(int pageIndex)
{
if (ViewModel.Package.Images != null)
ViewModel.SelectedImage = ViewModel.Package.Images[pageIndex];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<LangVersion>preview</LangVersion>
<OutputPath>..\Output\Tests\</OutputPath>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);NU1605;NU1701;MSB3270</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class DummyDownloadablePackage : IDownloadablePackage
public long? ViewCount { get; } = null;
public long? DownloadCount { get; } = null;
public DateTime? Published { get; set; } = null!;
public string? Changelog { get; } = null!;
public string Changelog { get; } = null!;

public Task<string> DownloadAsync(string packageFolder, IProgress<double> progress, CancellationToken token = default)
{
Expand Down
2 changes: 2 additions & 0 deletions source/Reloaded.Mod.Loader.Update.Index/Structures/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ namespace Reloaded.Mod.Loader.Update.Index.Structures;
[Equals(DoNotAddEqualityOperators = true)]
public class Package : IDownloadablePackage
{
#pragma warning disable CS0067
public event PropertyChangedEventHandler? PropertyChanged;
#pragma warning restore CS0067

/// <inheritdoc />
public string Name { get; set; } = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public async Task<bool> TryRemoveAsync(CacheKey key)
await observable;
return result;
}
catch (KeyNotFoundException e)
catch (KeyNotFoundException)
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion source/Reloaded.Mod.Loader/Reloaded.Mod.Loader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EnableDynamicLoading>true</EnableDynamicLoading>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);NU1605</NoWarn>
<NoWarn>$(NoWarn);NU1605;NU1701</NoWarn>
<Version>1.19.2</Version>
<Platforms>x86;x64</Platforms>
<Deterministic>true</Deterministic>
Expand Down

0 comments on commit df925d3

Please sign in to comment.