Dev/crutkas/fixing warnings (#5161)

* new lines & braces

* Tabs /space auto fix

Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
This commit is contained in:
Clint Rutkas
2020-07-22 13:27:17 -07:00
committed by GitHub
parent 6efec9d280
commit 14247fa75a
114 changed files with 694 additions and 681 deletions

View File

@@ -36,7 +36,7 @@ namespace Wox.Infrastructure.Storage
// Depending on the version number of the previously installed PT Run, delete the cache if it is found to be incompatible
if (_storageHelper.clearCache)
{
if(File.Exists(FilePath))
if (File.Exists(FilePath))
{
File.Delete(FilePath);
Log.Info($"|BinaryStorage.TryLoad|Deleting cached data| <{FilePath}>");

View File

@@ -8,14 +8,14 @@ namespace Wox.Infrastructure.Storage
{
public FileSystemWatcherWrapper() { }
Collection<string> IFileSystemWatcherWrapper.Filters
{
Collection<string> IFileSystemWatcherWrapper.Filters
{
get => this.Filters;
set
{
if(value != null)
set
{
if (value != null)
{
foreach(string filter in value)
foreach (string filter in value)
{
this.Filters.Add(filter);
}

View File

@@ -40,7 +40,7 @@ namespace Wox.Infrastructure.Storage
// Depending on the version number of the previously installed PT Run, delete the cache if it is found to be incompatible
if (_storageHelper.clearCache)
{
if(File.Exists(FilePath))
if (File.Exists(FilePath))
{
File.Delete(FilePath);
Log.Info($"|JsonStorage.TryLoad|Deleting cached data|<{FilePath}>");

View File

@@ -25,7 +25,7 @@ namespace Wox.Infrastructure.Storage
public ListRepository()
{
}
public void Set(IList<T> items)
@@ -35,7 +35,7 @@ namespace Wox.Infrastructure.Storage
{
_items = new ConcurrentDictionary<int, T>(items.ToDictionary(i => i.GetHashCode()));
}
catch(ArgumentException e)
catch (ArgumentException e)
{
Log.Info($"|LisRepository.Set| Trying to insert a duplicate item", e.Message);
}
@@ -52,7 +52,7 @@ namespace Wox.Infrastructure.Storage
{
Log.Error($"|ListRepository.Add| Item Already Exists <{insertedItem}>");
}
}
public void Remove(T removedItem)

View File

@@ -2,7 +2,7 @@
namespace Wox.Infrastructure.Storage
{
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
public class PluginJsonStorage<T> : JsonStorage<T> where T : new()
{
public PluginJsonStorage()
{

View File

@@ -11,7 +11,7 @@ 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 FilePath { get; set; } = String.Empty;
@@ -32,17 +32,17 @@ 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;
}
string[] split1 = version1.Split( new string[] { version, period }, StringSplitOptions.RemoveEmptyEntries);
string[] split2 = version2.Split( new string[] { version, period }, StringSplitOptions.RemoveEmptyEntries);
string[] split1 = version1.Split(new string[] { version, period }, StringSplitOptions.RemoveEmptyEntries);
string[] split2 = version2.Split(new string[] { version, period }, StringSplitOptions.RemoveEmptyEntries);
for(int i=0; i<versionLength; i++)
for (int i = 0; i < versionLength; i++)
{
if(int.Parse(split1[i]) < int.Parse(split2[i]))
if (int.Parse(split1[i]) < int.Parse(split2[i]))
{
return true;
}
@@ -70,11 +70,11 @@ namespace Wox.Infrastructure.Storage
string cacheSuffix = ".cache";
string jsonSuffix = ".json";
if(type == (uint)StorageType.BINARY_STORAGE)
if (type == (uint)StorageType.BINARY_STORAGE)
{
suffix = cacheSuffix;
}
else if(type == (uint)StorageType.JSON_STORAGE)
else if (type == (uint)StorageType.JSON_STORAGE)
{
suffix = jsonSuffix;
}