Skip to content

Commit

Permalink
NR: fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbe2277 committed Dec 28, 2024
1 parent 4838ef4 commit 893f5fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/NewsReader/NewsReader.Presentation/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ public App(ISettingsService settingsService, IAppInfoService appInfoService, Laz

InitializeComponent();
this.appController = appController.Value;
MainPage = (Page)this.appController.MainView;
}

public static string LogFileName { get; } = Path.Combine(FileSystem.CacheDirectory, "Logging", "AppLog.txt");

protected override Window CreateWindow(IActivationState? activationState)
{
var window = base.CreateWindow(activationState);
window.Title = AppInfo.Name;
window.MinimumWidth = 300;
window.MinimumHeight = 400;
var window = new Window((Page)appController.MainView)
{
Title = AppInfo.Name,
MinimumWidth = 300,
MinimumHeight = 400
};
window.Created += (_, _) => OnCreated();
window.Deactivated += (_, _) => OnDeactivated();
window.Stopped += (_, _) => OnStopped();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
[assembly: SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "<Pending>", Scope = "member", Target = "~M:Waf.NewsReader.Presentation.Services.DataService.Save(System.Object)")]
[assembly: SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "<Pending>", Scope = "member", Target = "~M:Waf.NewsReader.Presentation.Services.WebStorageService.DownloadFile(System.String)~System.Threading.Tasks.Task{System.ValueTuple{System.IO.Stream,System.String}}")]
[assembly: SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "<Pending>", Scope = "member", Target = "~M:Waf.NewsReader.Presentation.Services.WebStorageService.UploadFile(System.IO.Stream)~System.Threading.Tasks.Task{System.String}")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>", Scope = "member", Target = "~M:Waf.NewsReader.Presentation.App.OnDeactivated")]
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public string GetHash()
{
using var stream = GetReadStream();
using var sha1 = SHA1.Create();
return BitConverter.ToString(sha1.ComputeHash(stream)).Replace("-", "", StringComparison.Ordinal);
return Convert.ToHexString(sha1.ComputeHash(stream));
}

public async Task<T?> Load<T>(Stream? dataStream = null) where T : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Waf.NewsReader.Presentation.Services;

public class MessageService : IMessageService
{
public Task ShowMessage(string message) => Application.Current!.MainPage!.DisplayAlert(Resources.Info, message, Resources.Ok);
public Task ShowMessage(string message) => Application.Current!.Windows[0].Page!.DisplayAlert(Resources.Info, message, Resources.Ok);

public Task<bool> ShowYesNoQuestion(string message) => Application.Current!.MainPage!.DisplayAlert(Resources.Question, message, Resources.Yes, Resources.No);
public Task<bool> ShowYesNoQuestion(string message) => Application.Current!.Windows[0].Page!.DisplayAlert(Resources.Question, message, Resources.Yes, Resources.No);
}

0 comments on commit 893f5fa

Please sign in to comment.