Skip to content

Commit

Permalink
feat: Update Nuget Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Soap-141 committed May 16, 2024
1 parent acd61ef commit 0ec0869
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ dotnet_diagnostic.SA1210.severity = suggestion
dotnet_diagnostic.CA1308.severity = none
# CS1587: XML comment is not placed on a valid language element
dotnet_diagnostic.CS1587.severity = none
# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = none

# VSTHRD110: This one is bugged: https://github.com/microsoft/vs-threading/issues/899
dotnet_diagnostic.VSTHRD110.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public KillSwitchService(IKillSwitchRepository killSwitchRepository, ILogger<Kil

/// <inheritdoc/>
public IObservable<bool> ObserveKillSwitchActivation() => _killSwitchRepository.ObserveKillSwitchActivation()
.Do(isActive => _logger.LogInformation("Kill switch is now {isActive}.", isActive));
.Do(isActive => _logger.LogInformation("Kill switch is now {IsActive}.", isActive));
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ public static class ConfigurationConfiguration
/// <param name="environmentManager">The environment manager.</param>
public static IHostBuilder AddConfiguration(this IHostBuilder hostBuilder, string folderPath, IEnvironmentManager environmentManager)
{
if (hostBuilder is null)
{
throw new ArgumentNullException(nameof(hostBuilder));
}
ArgumentNullException.ThrowIfNull(hostBuilder);

return hostBuilder
.AddConfiguration(environmentManager)
Expand Down Expand Up @@ -124,10 +121,7 @@ private static IConfigurationBuilder AddUserOverrideConfiguration(this IConfigur
/// <param name="environmentManager">The environment manager.</param>
private static IHostBuilder AddConfiguration(this IHostBuilder hostBuilder, IEnvironmentManager environmentManager)
{
if (hostBuilder is null)
{
throw new ArgumentNullException(nameof(hostBuilder));
}
ArgumentNullException.ThrowIfNull(hostBuilder);

return hostBuilder.ConfigureServices((hostBuilderContext, serviceCollection) => serviceCollection
.AddSingleton(serviceProvider => hostBuilderContext.Configuration)
Expand All @@ -136,7 +130,7 @@ private static IHostBuilder AddConfiguration(this IHostBuilder hostBuilder, IEnv
);
}

public class AppSettingsFile
public sealed class AppSettingsFile
{
private static AppSettingsFile[] _appSettingsFiles;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using static ApplicationTemplate.ConfigurationConfiguration;

namespace ApplicationTemplate;

/// <summary>
/// This implementation of <see cref="IEnvironmentManager"/> uses local files to support the override features.
/// </summary>
public class EnvironmentManager : IEnvironmentManager
public sealed class EnvironmentManager : IEnvironmentManager
{
//-:cnd:noEmit
#if PRODUCTION
Expand Down Expand Up @@ -58,10 +56,7 @@ public void ClearOverride()

public void Override(string environment)
{
if (environment == null)
{
throw new ArgumentNullException(nameof(environment));
}
ArgumentNullException.ThrowIfNull(environment);

environment = environment.ToUpperInvariant();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace DynamicData;

public static class ChangeSetExtensions
{
public static IEnumerable<T> GetAddedItems<T>(this IChangeSet<T> changeSet)
{
if (changeSet is null)
{
throw new ArgumentNullException(nameof(changeSet));
}
ArgumentNullException.ThrowIfNull(changeSet);

foreach (var change in changeSet)
{
Expand All @@ -38,10 +34,7 @@ public static IEnumerable<T> GetAddedItems<T>(this IChangeSet<T> changeSet)

public static IEnumerable<T> GetRemovedItems<T>(this IChangeSet<T> changeSet)
{
if (changeSet is null)
{
throw new ArgumentNullException(nameof(changeSet));
}
ArgumentNullException.ThrowIfNull(changeSet);

foreach (var change in changeSet)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Chinook.DynamicMvvm;
using Chinook.DynamicMvvm.Implementations;

namespace Chinook.DynamicMvvm;

Expand All @@ -20,10 +16,7 @@ public static class ChinookViewModelExtensionsForPropertiesFromDynamicProperty
/// <returns>The property's value.</returns>
public static T GetFromDynamicProperty<T>(this IViewModel viewModel, IDynamicProperty<T> source, [CallerMemberName] string name = null)
{
if (source is null)
{
throw new ArgumentNullException(nameof(source));
}
ArgumentNullException.ThrowIfNull(source);

return viewModel.Get<T>(viewModel.GetOrCreateDynamicProperty(name, n => new ValueChangedOnBackgroundTaskDynamicPropertyFromDynamicProperty<T>(name, source, viewModel, source.Value)));
}
Expand All @@ -41,10 +34,7 @@ public static T GetFromDynamicProperty<T>(this IViewModel viewModel, IDynamicPro
/// <returns>The property's value.</returns>
public static TResult GetFromDynamicProperty<TSource, TResult>(this IViewModel viewModel, IDynamicProperty<TSource> source, Func<TSource, TResult> selector, [CallerMemberName] string name = null)
{
if (source is null)
{
throw new ArgumentNullException(nameof(source));
}
ArgumentNullException.ThrowIfNull(source);

return viewModel.Get<TResult>(viewModel.GetOrCreateDynamicProperty(name, n =>
new ValueChangedOnBackgroundTaskDynamicPropertyFromDynamicProperty<TSource, TResult>(name, source, viewModel, selector, selector(source.Value))));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Chinook.DynamicMvvm.Implementations;

namespace Chinook.DynamicMvvm;
Expand Down Expand Up @@ -35,10 +33,7 @@ public override object Value
get => base.Value;
set
{
if (_isDisposed)
{
throw new ObjectDisposedException(Name);
}
ObjectDisposedException.ThrowIf(_isDisposed, this);

if (!Equals(value, base.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace ApplicationTemplate.Presentation;

public partial class DadJokesPageViewModel : ViewModel
public sealed partial class DadJokesPageViewModel : ViewModel
{
[Inject] private IDadJokesService _dadJokesService;
[Inject] private ISectionsNavigator _sectionsNavigator;
Expand Down Expand Up @@ -67,7 +67,7 @@ private async Task SetupFavoritesUpdate(CancellationToken ct)
void UpdateItemViewModels(IChangeSet<DadJokesQuote> changeSet)
{
var quotesVMs = Jokes.State.Data;
if (quotesVMs != null && quotesVMs.Any())
if (quotesVMs != null && quotesVMs.Length != 0)
{
var addedItems = changeSet.GetAddedItems();
var removedItems = changeSet.GetRemovedItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace ApplicationTemplate.Presentation;

public class DiagnosticsCountersService
public sealed class DiagnosticsCountersService
{
public event EventHandler CountersChanged;

Expand Down Expand Up @@ -92,18 +92,15 @@ private void OnCommandNotification(KeyValuePair<string, object> notification)
}
}

public partial class CountersData
public sealed partial class CountersData
{
public CountersData()
{
}

public CountersData(CountersData source)
{
if (source is null)
{
throw new ArgumentNullException(nameof(source));
}
ArgumentNullException.ThrowIfNull(source);

CreatedViewModels = source.CreatedViewModels;
DisposedViewModels = source.DisposedViewModels;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Reactive.Concurrency;
Expand All @@ -9,7 +8,6 @@
using System.Text.Json;
using ApplicationTemplate.DataAccess;
using Chinook.DynamicMvvm;
using Chinook.DynamicMvvm.Deactivation;
using DynamicData;
using Uno;
using Uno.Extensions;
Expand All @@ -18,6 +16,8 @@ namespace ApplicationTemplate.Presentation;

public sealed partial class HttpDebuggerViewModel : TabViewModel
{
private static readonly JsonSerializerOptions _jsonSerializerOptions = new JsonSerializerOptions { WriteIndented = true };

[Inject] private IHttpDebuggerService _httpDebuggerService;

public HttpDebuggerViewModel()
Expand Down Expand Up @@ -261,7 +261,7 @@ private static string TryFormatContent(string content, bool indentJson)
var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(content));
if (JsonDocument.TryParseValue(ref reader, out var jsonDoc))
{
return JsonSerializer.Serialize(jsonDoc, new JsonSerializerOptions { WriteIndented = true });
return JsonSerializer.Serialize(jsonDoc, _jsonSerializerOptions);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Globalization;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Threading;
Expand Down Expand Up @@ -180,7 +181,7 @@ private void ConfigureLogging(HostBuilderContext hostBuilderContext, ILoggingBui
var serilogConfiguration = new LoggerConfiguration()
.ReadFrom.Configuration(hostBuilderContext.Configuration)
.Enrich.With(new ThreadIdEnricher())
.WriteTo.TestOutput(_output, outputTemplate: "{Timestamp:HH:mm:ss.fff} Thread:{ThreadId} {Level:u1}/{SourceContext}: {Message:lj} {Exception}{NewLine}");
.WriteTo.TestOutput(_output, outputTemplate: "{Timestamp:HH:mm:ss.fff} Thread:{ThreadId} {Level:u1}/{SourceContext}: {Message:lj} {Exception}{NewLine}", formatProvider: CultureInfo.InvariantCulture);

var logger = serilogConfiguration.CreateLogger();
loggingBuilder.AddSerilog(logger);
Expand Down Expand Up @@ -209,7 +210,6 @@ protected virtual IServiceCollection ReplaceWithMock<TService>(IServiceCollectio
return services.Replace(ServiceDescriptor.Singleton<TService>(mockedService));
}


/// <summary>
/// Gets the application settings to use for this test.
/// </summary>
Expand Down

0 comments on commit 0ec0869

Please sign in to comment.