mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
more fixes for getting styleCop up, this will need one more push to get another 15 that will require renaming of vars (#5875)
This commit is contained in:
@@ -77,7 +77,7 @@ namespace Wox.Infrastructure.Storage
|
||||
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter
|
||||
{
|
||||
AssemblyFormat = FormatterAssemblyStyle.Simple
|
||||
AssemblyFormat = FormatterAssemblyStyle.Simple,
|
||||
};
|
||||
|
||||
try
|
||||
@@ -119,7 +119,7 @@ namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter
|
||||
{
|
||||
AssemblyFormat = FormatterAssemblyStyle.Simple
|
||||
AssemblyFormat = FormatterAssemblyStyle.Simple,
|
||||
};
|
||||
|
||||
try
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace Wox.Infrastructure.Storage
|
||||
// File System Watcher Wrapper class which implements the IFileSystemWatcherWrapper interface
|
||||
public class FileSystemWatcherWrapper : FileSystemWatcher, IFileSystemWatcherWrapper
|
||||
{
|
||||
public FileSystemWatcherWrapper() { }
|
||||
public FileSystemWatcherWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
Collection<string> IFileSystemWatcherWrapper.Filters
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Wox.Infrastructure.Storage
|
||||
_serializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,10 @@ namespace Wox.Infrastructure.Storage
|
||||
/// <typeparam name="T">typeof</typeparam>
|
||||
public class ListRepository<T> : IRepository<T>, IEnumerable<T>
|
||||
{
|
||||
public IList<T> Items { get { return _items.Values.ToList(); } }
|
||||
public IList<T> Items
|
||||
{
|
||||
get { return _items.Values.ToList(); }
|
||||
}
|
||||
|
||||
private ConcurrentDictionary<int, T> _items = new ConcurrentDictionary<int, T>();
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ using System.IO;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
public class PluginJsonStorage<T> : JsonStorage<T> where T : new()
|
||||
public class PluginJsonStorage<T> : JsonStorage<T>
|
||||
where T : new()
|
||||
{
|
||||
public PluginJsonStorage()
|
||||
{
|
||||
|
||||
@@ -12,16 +12,16 @@ namespace Wox.Infrastructure.Storage
|
||||
// This detail is accessed by the storage items and is used to decide if the cache must be deleted or not
|
||||
public bool clearCache = false;
|
||||
|
||||
private String currentPowerToysVersion = String.Empty;
|
||||
private string currentPowerToysVersion = string.Empty;
|
||||
|
||||
private String FilePath { get; set; } = String.Empty;
|
||||
private string FilePath { get; set; } = string.Empty;
|
||||
|
||||
// As of now this information is not pertinent but may be in the future
|
||||
// There may be cases when we want to delete only the .cache files and not the .json storage files
|
||||
private enum StorageType
|
||||
{
|
||||
BINARY_STORAGE = 0,
|
||||
JSON_STORAGE = 1
|
||||
JSON_STORAGE = 1,
|
||||
}
|
||||
|
||||
// To compare the version numbers
|
||||
@@ -33,7 +33,7 @@ namespace Wox.Infrastructure.Storage
|
||||
|
||||
// If there is some error in populating/retrieving the version numbers, then the cache must be deleted
|
||||
// This case will not be hit, but is present as a fail safe
|
||||
if (String.IsNullOrEmpty(version1) || String.IsNullOrEmpty(version2))
|
||||
if (string.IsNullOrEmpty(version1) || string.IsNullOrEmpty(version2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ namespace Wox.Infrastructure.Storage
|
||||
}
|
||||
}
|
||||
|
||||
private string GetFilePath(String AssociatedFilePath, int type)
|
||||
private string GetFilePath(string AssociatedFilePath, int type)
|
||||
{
|
||||
string suffix = string.Empty;
|
||||
string cacheSuffix = ".cache";
|
||||
@@ -100,12 +100,12 @@ namespace Wox.Infrastructure.Storage
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public StoragePowerToysVersionInfo(String AssociatedFilePath, int type)
|
||||
public StoragePowerToysVersionInfo(string AssociatedFilePath, int type)
|
||||
{
|
||||
FilePath = GetFilePath(AssociatedFilePath, type);
|
||||
|
||||
// Get the previous version of PowerToys and cache Storage details from the CacheDetails.json storage file
|
||||
String previousVersion = GetPreviousVersion();
|
||||
string previousVersion = GetPreviousVersion();
|
||||
currentPowerToysVersion = Microsoft.PowerToys.Settings.UI.Lib.Utilities.Helper.GetProductVersion();
|
||||
|
||||
// If the previous version is below a set threshold, then we want to delete the file
|
||||
|
||||
@@ -6,7 +6,8 @@ using System.IO;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
public class WoxJsonStorage<T> : JsonStorage<T> where T : new()
|
||||
public class WoxJsonStorage<T> : JsonStorage<T>
|
||||
where T : new()
|
||||
{
|
||||
public WoxJsonStorage()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user