mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Incremental fix for StyleCop on Infra (#5729)
* Fixes file names and classes don't match. All but PluginsSettings * making it pluginsettings * fixing due to conflict
This commit is contained in:
@@ -16,6 +16,7 @@ namespace Wox.Infrastructure.Storage
|
||||
/// Storage object using binary data
|
||||
/// Normally, it has better performance, but not readable
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public class BinaryStorage<T> : IStorage<T>
|
||||
{
|
||||
// This storage helper returns whether or not to delete the binary storage items
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public interface IRepository<T>
|
||||
{
|
||||
void Add(T insertedItem);
|
||||
|
||||
@@ -4,18 +4,19 @@
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public interface IStorage<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Saves the data
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="data">data to be saved</param>
|
||||
void Save(T data);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to load data, otherwise it will return the default provided
|
||||
/// </summary>
|
||||
/// <param name="defaultData"></param>
|
||||
/// <param name="defaultData">default data value</param>
|
||||
/// <returns>The loaded data or default</returns>
|
||||
T TryLoad(T defaultData);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Wox.Infrastructure.Storage
|
||||
/// <summary>
|
||||
/// Serialize object using json format.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public class JsonStorage<T>
|
||||
{
|
||||
private readonly JsonSerializerSettings _serializerSettings;
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace Wox.Infrastructure.Storage
|
||||
/// The intent of this class is to provide a basic subset of 'list' like operations, without exposing callers to the internal representation
|
||||
/// of the data structure. Currently this is implemented as a list for it's simplicity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <typeparam name="T">typeof</typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public class ListRepository<T> : IRepository<T>, IEnumerable<T>
|
||||
{
|
||||
public IList<T> Items { get { return _items.Values.ToList(); } }
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.IO;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public class PluginJsonStorage<T> : JsonStorage<T> where T : new()
|
||||
{
|
||||
public PluginJsonStorage()
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.IO;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
|
||||
public class WoxJsonStorage<T> : JsonStorage<T> where T : new()
|
||||
{
|
||||
public WoxJsonStorage()
|
||||
|
||||
Reference in New Issue
Block a user