Updated ISettingsStorageHelper references

This commit is contained in:
Shane Weaver 2021-07-22 12:15:58 -07:00
Родитель 8476f708f2
Коммит e921d89482
7 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -418,7 +418,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Controls
/// <summary>
/// The local app data storage helper for storing settings.
/// </summary>
private ISettingsStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
private readonly ApplicationDataStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent();
/// <summary>
/// DocFX note types and styling info, keyed by identifier.

Просмотреть файл

@ -46,7 +46,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
public static async void EnsureCacheLatest()
{
ISettingsStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
var settingsStorage = ApplicationDataStorageHelper.GetCurrent();
var onlineDocsSHA = await GetDocsSHA();
var cacheSHA = settingsStorage.Read<string>(_cacheSHAKey);

Просмотреть файл

@ -22,7 +22,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
private static SemaphoreSlim _semaphore = new SemaphoreSlim(1);
private static LinkedList<Sample> _recentSamples;
private static ISettingsStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
private static ApplicationDataStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent();
public static async Task<SampleCategory> GetCategoryBySample(Sample sample)
{

Просмотреть файл

@ -10,7 +10,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
public sealed partial class ObjectStoragePage
{
private readonly ISettingsStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
private readonly ApplicationDataStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent();
public ObjectStoragePage()
{

Просмотреть файл

@ -26,7 +26,7 @@ namespace Microsoft.Toolkit.Uwp.Helpers
/// <summary>
/// The <see cref="ApplicationDataStorageHelper"/> instance used to save and retrieve application settings.
/// </summary>
private readonly ISettingsStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
private readonly ApplicationDataStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent();
/// <summary>
/// The starting time of the current application session (since app launch or last move to foreground).

Просмотреть файл

@ -15,9 +15,9 @@ namespace UnitTests.Helpers
[TestClass]
public class Test_StorageHelper
{
private ISettingsStorageHelper _settingsStorage_System = ApplicationDataStorageHelper.GetCurrent(new Microsoft.Toolkit.Helpers.SystemSerializer());
private ISettingsStorageHelper _settingsStorage_JsonCompat = ApplicationDataStorageHelper.GetCurrent(new JsonObjectSerializer());
private ISettingsStorageHelper _settingsStorage_JsonNew = ApplicationDataStorageHelper.GetCurrent(new SystemTextJsonSerializer());
private readonly ISettingsStorageHelper<string> _settingsStorage_System = ApplicationDataStorageHelper.GetCurrent();
private readonly ISettingsStorageHelper<string> _settingsStorage_JsonCompat = ApplicationDataStorageHelper.GetCurrent(new JsonObjectSerializer());
private readonly ISettingsStorageHelper<string> _settingsStorage_JsonNew = ApplicationDataStorageHelper.GetCurrent(new SystemTextJsonSerializer());
/// <summary>
/// Checks that we're running 10.0.3 version of Newtonsoft.Json package which we used in 6.1.1.

Просмотреть файл

@ -58,7 +58,7 @@ namespace UnitTests.Helpers
// Simulate a first app startup
_ = (SystemInformation)Activator.CreateInstance(typeof(SystemInformation), nonPublic: true);
ISettingsStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Microsoft.Toolkit.Helpers.SystemSerializer());
var settingsStorage = ApplicationDataStorageHelper.GetCurrent();
PackageVersion previousVersion = new() { Build = 42, Major = 1111, Minor = 2222, Revision = 12345 };
settingsStorage.Save("currentVersion", previousVersion.ToFormattedString());