Skip to content

Commit e921d89

Browse files
committed
Updated ISettingsStorageHelper references
1 parent 8476f70 commit e921d89

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

Microsoft.Toolkit.Uwp.SampleApp/Controls/SampleAppMarkdownRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public string DesiredLang
418418
/// <summary>
419419
/// The local app data storage helper for storing settings.
420420
/// </summary>
421-
private ISettingsStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
421+
private readonly ApplicationDataStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent();
422422

423423
/// <summary>
424424
/// DocFX note types and styling info, keyed by identifier.

Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class Sample
4646

4747
public static async void EnsureCacheLatest()
4848
{
49-
ISettingsStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
49+
var settingsStorage = ApplicationDataStorageHelper.GetCurrent();
5050

5151
var onlineDocsSHA = await GetDocsSHA();
5252
var cacheSHA = settingsStorage.Read<string>(_cacheSHAKey);

Microsoft.Toolkit.Uwp.SampleApp/Models/Samples.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static class Samples
2222
private static SemaphoreSlim _semaphore = new SemaphoreSlim(1);
2323

2424
private static LinkedList<Sample> _recentSamples;
25-
private static ISettingsStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
25+
private static ApplicationDataStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent();
2626

2727
public static async Task<SampleCategory> GetCategoryBySample(Sample sample)
2828
{

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Object Storage/ObjectStoragePage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1010
{
1111
public sealed partial class ObjectStoragePage
1212
{
13-
private readonly ISettingsStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
13+
private readonly ApplicationDataStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent();
1414

1515
public ObjectStoragePage()
1616
{

Microsoft.Toolkit.Uwp/Helpers/SystemInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public sealed class SystemInformation
2626
/// <summary>
2727
/// The <see cref="ApplicationDataStorageHelper"/> instance used to save and retrieve application settings.
2828
/// </summary>
29-
private readonly ISettingsStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());
29+
private readonly ApplicationDataStorageHelper _settingsStorage = ApplicationDataStorageHelper.GetCurrent();
3030

3131
/// <summary>
3232
/// The starting time of the current application session (since app launch or last move to foreground).

UnitTests/UnitTests.UWP/Helpers/Test_StorageHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace UnitTests.Helpers
1515
[TestClass]
1616
public class Test_StorageHelper
1717
{
18-
private ISettingsStorageHelper _settingsStorage_System = ApplicationDataStorageHelper.GetCurrent(new Microsoft.Toolkit.Helpers.SystemSerializer());
19-
private ISettingsStorageHelper _settingsStorage_JsonCompat = ApplicationDataStorageHelper.GetCurrent(new JsonObjectSerializer());
20-
private ISettingsStorageHelper _settingsStorage_JsonNew = ApplicationDataStorageHelper.GetCurrent(new SystemTextJsonSerializer());
18+
private readonly ISettingsStorageHelper<string> _settingsStorage_System = ApplicationDataStorageHelper.GetCurrent();
19+
private readonly ISettingsStorageHelper<string> _settingsStorage_JsonCompat = ApplicationDataStorageHelper.GetCurrent(new JsonObjectSerializer());
20+
private readonly ISettingsStorageHelper<string> _settingsStorage_JsonNew = ApplicationDataStorageHelper.GetCurrent(new SystemTextJsonSerializer());
2121

2222
/// <summary>
2323
/// Checks that we're running 10.0.3 version of Newtonsoft.Json package which we used in 6.1.1.

UnitTests/UnitTests.UWP/Helpers/Test_SystemInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void Test_SystemInformation_ConsistentInfoForStartupWithUpdate()
5858
// Simulate a first app startup
5959
_ = (SystemInformation)Activator.CreateInstance(typeof(SystemInformation), nonPublic: true);
6060

61-
ISettingsStorageHelper settingsStorage = ApplicationDataStorageHelper.GetCurrent(new Microsoft.Toolkit.Helpers.SystemSerializer());
61+
var settingsStorage = ApplicationDataStorageHelper.GetCurrent();
6262
PackageVersion previousVersion = new() { Build = 42, Major = 1111, Minor = 2222, Revision = 12345 };
6363

6464
settingsStorage.Save("currentVersion", previousVersion.ToFormattedString());

0 commit comments

Comments
 (0)