mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-02 18:44:56 +12:00
Update code analyzers and fix new warnings
New (latest) versions: Microsoft.CodeAnalysis.NetAnalyzers 8.0.0-preview1.23165.1 StyleCop.Analyzers 1.2.0-beta.507
This commit is contained in:
parent
da4ec8bec4
commit
0eef578377
8
.stylecop.json
Normal file
8
.stylecop.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||||
|
"settings": {
|
||||||
|
"orderingRules": {
|
||||||
|
"usingDirectivesPlacement": "insideNamespace"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,8 +52,9 @@ namespace SystemTrayMenu
|
||||||
{
|
{
|
||||||
Settings.Default.PathIcoDirectory = System.IO.Path.Combine(
|
Settings.Default.PathIcoDirectory = System.IO.Path.Combine(
|
||||||
System.IO.Path.Combine(
|
System.IO.Path.Combine(
|
||||||
Environment.GetFolderPath(
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||||
Environment.SpecialFolder.ApplicationData), $"SystemTrayMenu"), "ico");
|
$"SystemTrayMenu"),
|
||||||
|
"ico");
|
||||||
if (!Directory.Exists(Settings.Default.PathIcoDirectory))
|
if (!Directory.Exists(Settings.Default.PathIcoDirectory))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(Settings.Default.PathIcoDirectory);
|
Directory.CreateDirectory(Settings.Default.PathIcoDirectory);
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace SystemTrayMenu.Helpers
|
||||||
// Only this ensures caller and registrator are talking about the SAME registration.
|
// Only this ensures caller and registrator are talking about the SAME registration.
|
||||||
internal static IHotkeyFunction? GetLastCreatedHotkeyFunction() => lastCreatedHotkeyFunction;
|
internal static IHotkeyFunction? GetLastCreatedHotkeyFunction() => lastCreatedHotkeyFunction;
|
||||||
|
|
||||||
internal static (ModifierKeys, Key) ModifiersAndKeyFromInvariantString(string hotKeyString)
|
internal static (ModifierKeys Modifiers, Key Key) ModifiersAndKeyFromInvariantString(string hotKeyString)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(hotKeyString))
|
if (string.IsNullOrEmpty(hotKeyString))
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,19 +104,8 @@
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
<NoWarn>1701;1702;WFAC010;MSB3061</NoWarn>
|
<NoWarn>1701;1702;WFAC010;MSB3061</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Remove="UserInterface\HotkeyTextboxControl\**" />
|
|
||||||
<EmbeddedResource Remove="UserInterface\HotkeyTextboxControl\**" />
|
|
||||||
<None Remove="UserInterface\HotkeyTextboxControl\**" />
|
|
||||||
<Page Remove="UserInterface\HotkeyTextboxControl\**" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Remove="UserInterface\Menu.resx" />
|
<EmbeddedResource Remove="UserInterface\Menu.resx" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Page Remove="Business\App.xaml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ApplicationDefinition Include="Business\App.xaml" />
|
<ApplicationDefinition Include="Business\App.xaml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -124,6 +113,7 @@
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>ThirdParty\Clearcove.Logging.dll</HintPath>
|
<HintPath>ThirdParty\Clearcove.Logging.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<AdditionalFiles Include=".stylecop.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Properties\Settings.Designer.cs">
|
<Compile Update="Properties\Settings.Designer.cs">
|
||||||
|
@ -167,12 +157,12 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="H.NotifyIcon" Version="2.0.115" />
|
<PackageReference Include="H.NotifyIcon" Version="2.0.115" />
|
||||||
<PackageReference Include="HidSharp" Version="2.1.0" />
|
<PackageReference Include="HidSharp" Version="2.1.0" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.3">
|
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview1.23165.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="PixiEditor.ColorPicker" Version="3.3.1" />
|
<PackageReference Include="PixiEditor.ColorPicker" Version="3.3.1" />
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace SystemTrayMenu.UserInterface
|
||||||
private string? strParentFolder;
|
private string? strParentFolder;
|
||||||
|
|
||||||
public ShellContextMenu()
|
public ShellContextMenu()
|
||||||
: base(new())
|
: base(default)
|
||||||
{
|
{
|
||||||
hook = new HwndSourceHook(WndProc);
|
hook = new HwndSourceHook(WndProc);
|
||||||
AddHook(hook);
|
AddHook(hook);
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace SystemTrayMenu.Utilities
|
||||||
|
|
||||||
internal static Point GetRelativeChildPositionTo(this Visual parent, Visual? child)
|
internal static Point GetRelativeChildPositionTo(this Visual parent, Visual? child)
|
||||||
{
|
{
|
||||||
return child == null ? new() : child.TransformToAncestor(parent).Transform(new ());
|
return child == null ? default : child.TransformToAncestor(parent).Transform(default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue