Fixed Warnings
This commit is contained in:
@@ -11,7 +11,7 @@ using System.Threading;
|
||||
|
||||
namespace AvaloniaSerilogNoDI;
|
||||
|
||||
public partial class MainWindow : Window, ILogDataStoreImpl
|
||||
public partial class MainWindow : Window, ILogDataStoreCore
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
@@ -20,11 +20,11 @@ public partial class MainWindow : Window, ILogDataStoreImpl
|
||||
InitializeComponent();
|
||||
|
||||
// Initialize _service and pass in the Logger
|
||||
_service = new(new Logger<RandomLoggingService>(LoggingHelper.Factory));
|
||||
Service = new(new Logger<RandomLoggingService>(LoggingHelper.Factory));
|
||||
|
||||
// Get the Launch mode
|
||||
bool isDevelopment = string.Equals(Environment.GetEnvironmentVariable("DOTNET_MODIFIABLE_ASSEMBLIES"), "debug",
|
||||
StringComparison.InvariantCultureIgnoreCase);
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
// initialize a logger & EventId
|
||||
Logger<MainWindow> logger = new Logger<MainWindow>(LoggingHelper.Factory);
|
||||
@@ -37,7 +37,7 @@ public partial class MainWindow : Window, ILogDataStoreImpl
|
||||
logger.Emit(eventId, LogLevel.Information, $"Running in {(isDevelopment ? "Debug" : "Release")} mode");
|
||||
|
||||
// Start generating log entries
|
||||
_ = _service.StartAsync(CancellationToken.None);
|
||||
_ = Service.StartAsync(CancellationToken.None);
|
||||
|
||||
// manually wire up the logging to the view ... the control will show backlog entries...
|
||||
DataStore = MainControlsDataStore.DataStore;
|
||||
@@ -52,12 +52,9 @@ public partial class MainWindow : Window, ILogDataStoreImpl
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
private readonly RandomLoggingService? _service;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private RandomLoggingService? Service { get; set;}
|
||||
|
||||
#region Properties
|
||||
|
||||
public ILogDataStore DataStore { get; init; }
|
||||
@@ -71,7 +68,7 @@ public partial class MainWindow : Window, ILogDataStoreImpl
|
||||
{
|
||||
Window.Closing -= OnClosing;
|
||||
|
||||
_ = _service?.StopAsync();
|
||||
_ = Service?.StopAsync();
|
||||
LoggingHelper.CloseAndFlush();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user