smaller stylecop fixes in Wox.Core and Wox.Infra (#5671)

* Headers
unneeded usings
files need blank line at bottom
Fixed double returns
Returns after braces

* commenting out stylecop
This commit is contained in:
Clint Rutkas
2020-08-05 14:06:42 -07:00
committed by GitHub
parent 30b65028fe
commit 92a2b83bc8
50 changed files with 308 additions and 116 deletions

View File

@@ -1,8 +1,11 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Media;
namespace Wox.Infrastructure.Image
@@ -87,4 +90,4 @@ namespace Wox.Infrastructure.Image
}
}
}
}

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Security.Cryptography;
using System.Windows.Media;
@@ -10,6 +14,7 @@ namespace Wox.Infrastructure.Image
{
string GetHashFromImage(ImageSource image);
}
public class ImageHashGenerator : IImageHashGenerator
{
public string GetHashFromImage(ImageSource imageSource)
@@ -46,4 +51,4 @@ namespace Wox.Infrastructure.Image
}
}
}
}

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
@@ -32,7 +36,6 @@ namespace Wox.Infrastructure.Image
".ico"
};
public static void Initialize(Theme theme)
{
_storage = new BinaryStorage<Dictionary<string, int>>("Image");
@@ -45,6 +48,7 @@ namespace Wox.Infrastructure.Image
img.Freeze();
ImageCache[icon] = img;
}
UpdateIconPath(theme);
Task.Run(() =>
{
@@ -112,6 +116,7 @@ namespace Wox.Infrastructure.Image
{
return new ImageResult(ImageCache[ErrorIconPath], ImageType.Error);
}
if (ImageCache.ContainsKey(path))
{
return new ImageResult(ImageCache[path], ImageType.Cache);
@@ -188,6 +193,7 @@ namespace Wox.Infrastructure.Image
image = ImageCache[ErrorIconPath];
ImageCache[path] = image;
}
return new ImageResult(image, type);
}
@@ -221,7 +227,6 @@ namespace Wox.Infrastructure.Image
ImageCache[path] = img;
}
return img;
}
@@ -235,4 +240,4 @@ namespace Wox.Infrastructure.Image
return image;
}
}
}
}

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
using System.IO;
using System.Windows.Interop;
@@ -49,7 +53,8 @@ namespace Wox.Infrastructure.Image
void GetDisplayName(SIGDN sigdnName, out IntPtr ppszName);
void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs);
void Compare(IShellItem psi, uint hint, out int piOrder);
};
}
;
internal enum SIGDN : uint
{
@@ -101,8 +106,8 @@ namespace Wox.Infrastructure.Image
public int Width { set { width = value; } }
public int Height { set { height = value; } }
};
}
;
public static BitmapSource GetThumbnail(string fileName, int width, int height, ThumbnailOptions options)
{
@@ -150,4 +155,4 @@ namespace Wox.Infrastructure.Image
throw new COMException($"Error while extracting thumbnail for {fileName}", Marshal.GetExceptionForHR((int)hr));
}
}
}
}