[Feature] Migrate from deprecated FxCop analyzers to .NET analyzers (#152), version 1.0.17.16

This commit is contained in:
Markus Hofknecht 2021-04-17 02:39:48 +02:00
parent 83a9d29da2
commit a5e1ff4c25
36 changed files with 76 additions and 74 deletions

View file

@ -20,7 +20,7 @@ namespace SystemTrayMenu.Handler
private readonly KeyboardHook hook = new KeyboardHook(); private readonly KeyboardHook hook = new KeyboardHook();
private int iRowKey = -1; private int iRowKey = -1;
private int iMenuKey = 0; private int iMenuKey;
public KeyboardInput(Menu[] menus) public KeyboardInput(Menu[] menus)
{ {
@ -39,7 +39,7 @@ namespace SystemTrayMenu.Handler
internal event EventHandlerEmpty Cleared; internal event EventHandlerEmpty Cleared;
internal bool InUse { get; set; } = false; internal bool InUse { get; set; }
public void Dispose() public void Dispose()
{ {

View file

@ -29,15 +29,15 @@ namespace SystemTrayMenu.Business
private readonly DgvMouseRow dgvMouseRow = new DgvMouseRow(); private readonly DgvMouseRow dgvMouseRow = new DgvMouseRow();
private readonly WaitToLoadMenu waitToOpenMenu = new WaitToLoadMenu(); private readonly WaitToLoadMenu waitToOpenMenu = new WaitToLoadMenu();
private readonly KeyboardInput keyboardInput = null; private readonly KeyboardInput keyboardInput;
private readonly Timer timerStillActiveCheck = new Timer(); private readonly Timer timerStillActiveCheck = new Timer();
private readonly WaitLeave waitLeave = new WaitLeave(MenuDefines.TimeUntilClose); private readonly WaitLeave waitLeave = new WaitLeave(MenuDefines.TimeUntilClose);
private DateTime deactivatedTime = DateTime.MinValue; private DateTime deactivatedTime = DateTime.MinValue;
private OpenCloseState openCloseState = OpenCloseState.Default; private OpenCloseState openCloseState = OpenCloseState.Default;
private RowData loadingRowData = null; private RowData loadingRowData;
private bool showingMessageBox = false; private bool showingMessageBox;
private TaskbarPosition taskbarPosition = new WindowsTaskbar().Position; private TaskbarPosition taskbarPosition = new WindowsTaskbar().Position;
private bool searchTextChanging = false; private bool searchTextChanging;
public Menus() public Menus()
{ {
@ -480,7 +480,7 @@ namespace SystemTrayMenu.Business
menuToDispose.CmdKeyProcessed -= keyboardInput.CmdKeyProcessed; menuToDispose.CmdKeyProcessed -= keyboardInput.CmdKeyProcessed;
menuToDispose.SearchTextChanging -= keyboardInput.SearchTextChanging; menuToDispose.SearchTextChanging -= keyboardInput.SearchTextChanging;
menuToDispose.SearchTextChanged -= Menu_SearchTextChanged; menuToDispose.SearchTextChanged -= Menu_SearchTextChanged;
DataGridView dgv = menuToDispose?.GetDataGridView(); DataGridView dgv = menuToDispose.GetDataGridView();
if (dgv != null) if (dgv != null)
{ {
dgv.CellMouseEnter -= dgvMouseRow.CellMouseEnter; dgv.CellMouseEnter -= dgvMouseRow.CellMouseEnter;
@ -501,7 +501,7 @@ namespace SystemTrayMenu.Business
} }
} }
menuToDispose?.Dispose(); menuToDispose.Dispose();
} }
} }

View file

@ -14,12 +14,12 @@ namespace SystemTrayMenu.Handler
internal class WaitToLoadMenu : IDisposable internal class WaitToLoadMenu : IDisposable
{ {
private readonly Timer timerStartLoad = new Timer(); private readonly Timer timerStartLoad = new Timer();
private DataGridView dgv = null; private DataGridView dgv;
private int rowIndex = 0; private int rowIndex;
private DataGridView dgvTmp = null; private DataGridView dgvTmp;
private int rowIndexTmp = 0; private int rowIndexTmp;
private int mouseMoveEvents = 0; private int mouseMoveEvents;
private DateTime dateTimeLastMouseMoveEvent = DateTime.Now; private DateTime dateTimeLastMouseMoveEvent = DateTime.Now;
private bool checkForMouseActive = true; private bool checkForMouseActive = true;
@ -37,7 +37,7 @@ namespace SystemTrayMenu.Handler
internal event Action<DataGridView, int> MouseEnterOk; internal event Action<DataGridView, int> MouseEnterOk;
internal bool MouseActive { get; set; } = false; internal bool MouseActive { get; set; }
public void Dispose() public void Dispose()
{ {

View file

@ -15,10 +15,10 @@ namespace SystemTrayMenu
public static class Config public static class Config
{ {
private static bool readDarkModeDone = false; private static bool readDarkModeDone;
private static bool isDarkMode = false; private static bool isDarkMode;
private static bool readHideFileExtdone = false; private static bool readHideFileExtdone;
private static bool isHideFileExtension = false; private static bool isHideFileExtension;
public static bool IsHideFileExtdone => IsHideFileExtension(); public static bool IsHideFileExtdone => IsHideFileExtension();

View file

@ -26,9 +26,9 @@ namespace SystemTrayMenu.DataClasses
private string workingDirectory; private string workingDirectory;
private string arguments; private string arguments;
private string text; private string text;
private Icon icon = null; private Icon icon;
private bool diposeIcon = true; private bool diposeIcon = true;
private bool isDisposed = false; private bool isDisposed;
internal RowData() internal RowData()
{ {
@ -366,7 +366,8 @@ namespace SystemTrayMenu.DataClasses
{ {
Log.Warn( Log.Warn(
$"path:'{TargetFilePath}', " + $"path:'{TargetFilePath}', " +
$"iconFile:'{iconFile}'", ex); $"iconFile:'{iconFile}'",
ex);
} }
else else
{ {
@ -404,7 +405,8 @@ namespace SystemTrayMenu.DataClasses
{ {
Log.Warn( Log.Warn(
$"path:'{TargetFilePath}', " + $"path:'{TargetFilePath}', " +
$"executable:'{executable}'", ex); $"executable:'{executable}'",
ex);
} }
else else
{ {

View file

@ -10,8 +10,8 @@ namespace SystemTrayMenu.Helper
public class DgvMouseRow : IDisposable public class DgvMouseRow : IDisposable
{ {
private readonly Timer timerRaiseRowMouseLeave = new Timer(); private readonly Timer timerRaiseRowMouseLeave = new Timer();
private DataGridView dgv = null; private DataGridView dgv;
private DataGridViewCellEventArgs eventArgs = null; private DataGridViewCellEventArgs eventArgs;
internal DgvMouseRow() internal DgvMouseRow()
{ {

View file

@ -22,8 +22,8 @@ namespace SystemTrayMenu.UserInterface
private readonly Timer timer = new Timer(); private readonly Timer timer = new Timer();
private FadingState state = FadingState.Idle; private FadingState state = FadingState.Idle;
private double opacity = 0.00; private double opacity;
private bool visible = false; private bool visible;
internal Fading() internal Fading()
{ {

View file

@ -42,27 +42,27 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool IsIconic(IntPtr hWnd); private static extern bool IsIconic(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern IntPtr GetForegroundWindow(); private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId); private static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern uint GetCurrentThreadId(); private static extern uint GetCurrentThreadId();
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach); private static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool BringWindowToTop(IntPtr hWnd); private static extern bool BringWindowToTop(IntPtr hWnd);
} }
} }

View file

@ -19,7 +19,7 @@ namespace SystemTrayMenu.DllImports
// The CreatePopupMenu function creates a drop-down menu, submenu, or shortcut menu. The menu is initially empty. You can insert or append menu items by using the InsertMenuItem function. You can also use the InsertMenu function to insert menu items and the AppendMenu function to append menu items. // The CreatePopupMenu function creates a drop-down menu, submenu, or shortcut menu. The menu is initially empty. You can insert or append menu items by using the InsertMenuItem function. You can also use the InsertMenu function to insert menu items and the AppendMenu function to append menu items.
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern IntPtr CreatePopupMenu(); private static extern IntPtr CreatePopupMenu();
} }
} }

View file

@ -18,7 +18,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int DestroyIcon(IntPtr hIcon); private static extern int DestroyIcon(IntPtr hIcon);
} }
} }

View file

@ -19,7 +19,7 @@ namespace SystemTrayMenu.DllImports
// The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies. // The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies.
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool DestroyMenu(IntPtr hMenu); private static extern bool DestroyMenu(IntPtr hMenu);
} }
} }

View file

@ -18,7 +18,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int FindExecutable(string lpFile, string lpDirectory, [Out] StringBuilder lpResult); private static extern int FindExecutable(string lpFile, string lpDirectory, [Out] StringBuilder lpResult);
} }
} }

View file

@ -18,7 +18,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
} }
} }

View file

@ -18,7 +18,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("gdi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("gdi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int GetDeviceCaps(IntPtr hdc, int nIndex); private static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
} }
} }

View file

@ -41,7 +41,7 @@ namespace SystemTrayMenu.DllImports
/// <param name="flags">flags.</param> /// <param name="flags">flags.</param>
/// <returns>IntPtr.</returns> /// <returns>IntPtr.</returns>
[DllImport("comctl32", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("comctl32", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
internal static extern IntPtr ImageList_GetIcon( internal static extern IntPtr ImageList_GetIcon(
IntPtr himl, IntPtr himl,
int i, int i,

View file

@ -19,7 +19,7 @@ namespace SystemTrayMenu.DllImports
// Determines the default menu item on the specified menu // Determines the default menu item on the specified menu
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int GetMenuDefaultItem(IntPtr hMenu, bool fByPos, uint gmdiFlags); private static extern int GetMenuDefaultItem(IntPtr hMenu, bool fByPos, uint gmdiFlags);
} }
} }

View file

@ -20,7 +20,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int GetSystemMetrics(int nIndex); private static extern int GetSystemMetrics(int nIndex);
} }
} }

View file

@ -34,21 +34,21 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint virtualKeyCode); private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint virtualKeyCode);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool UnregisterHotKey(IntPtr hWnd, int id); private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern uint MapVirtualKey(uint uCode, uint uMapType); private static extern uint MapVirtualKey(uint uCode, uint uMapType);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int GetKeyNameText(uint lParam, [Out] StringBuilder lpString, int nSize); private static extern int GetKeyNameText(uint lParam, [Out] StringBuilder lpString, int nSize);
} }
} }

View file

@ -41,7 +41,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData); private static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]

View file

@ -19,7 +19,7 @@ namespace SystemTrayMenu.DllImports
// Retrieves the IShellFolder interface for the desktop folder, which is the root of the Shell's namespace. // Retrieves the IShellFolder interface for the desktop folder, which is the root of the Shell's namespace.
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int SHGetDesktopFolder(out IntPtr ppshf); private static extern int SHGetDesktopFolder(out IntPtr ppshf);
} }
} }

View file

@ -30,7 +30,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("Shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("Shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern IntPtr SHGetFileInfo( private static extern IntPtr SHGetFileInfo(
string pszPath, string pszPath,
uint dwFileAttributes, uint dwFileAttributes,

View file

@ -19,7 +19,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("shfolder.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shfolder.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken, int dwFlags, StringBuilder lpszPath); private static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken, int dwFlags, StringBuilder lpszPath);
} }
} }

View file

@ -33,7 +33,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("user32.dll", EntryPoint = "SetWindowPos", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", EntryPoint = "SetWindowPos", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool SetWindowPos( private static extern bool SetWindowPos(
int hWnd, // Window handle int hWnd, // Window handle
int hWndInsertAfter, // Placement-order handle int hWndInsertAfter, // Placement-order handle

View file

@ -13,7 +13,7 @@ namespace SystemTrayMenu.DllImports
public static partial class NativeMethods public static partial class NativeMethods
{ {
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
} }
} }

View file

@ -17,7 +17,7 @@ namespace SystemTrayMenu.DllImports
} }
[DllImport("shlwapi.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shlwapi.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int StrCmpLogicalW(string x, string y); private static extern int StrCmpLogicalW(string x, string y);
} }
} }

View file

@ -20,7 +20,7 @@ namespace SystemTrayMenu.DllImports
// Takes a STRRET structure returned by IShellFolder::GetDisplayNameOf, converts it to a string, and places the result in a buffer. // Takes a STRRET structure returned by IShellFolder::GetDisplayNameOf, converts it to a string, and places the result in a buffer.
[DllImport("shlwapi.dll", EntryPoint = "StrRetToBuf", ExactSpelling = false, SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shlwapi.dll", EntryPoint = "StrRetToBuf", ExactSpelling = false, SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern int StrRetToBuf(IntPtr pstr, IntPtr pidl, StringBuilder pszBuf, int cchBuf); private static extern int StrRetToBuf(IntPtr pstr, IntPtr pidl, StringBuilder pszBuf, int cchBuf);
} }
} }

View file

@ -55,7 +55,7 @@ namespace SystemTrayMenu.DllImports
// The TrackPopupMenuEx function displays a shortcut menu at the specified location and tracks the selection of items on the shortcut menu. The shortcut menu can appear anywhere on the screen. // The TrackPopupMenuEx function displays a shortcut menu at the specified location and tracks the selection of items on the shortcut menu. The shortcut menu can appear anywhere on the screen.
[DllImport("user32.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("user32.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
private static extern uint TrackPopupMenuEx(IntPtr hmenu, TPM flags, int x, int y, IntPtr hwnd, IntPtr lptpm); private static extern uint TrackPopupMenuEx(IntPtr hmenu, TPM flags, int x, int y, IntPtr hwnd, IntPtr lptpm);
} }
} }

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.17.15")] [assembly: AssemblyVersion("1.0.17.16")]
[assembly: AssemblyFileVersion("1.0.17.15")] [assembly: AssemblyFileVersion("1.0.17.16")]

View file

@ -223,11 +223,12 @@
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6"> <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<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="StyleCop.Analyzers.Unstable" Version="1.2.0.164"> <PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View file

@ -1,6 +1,6 @@
namespace SystemTrayMenu.UserInterface namespace SystemTrayMenu.UserInterface
{ {
partial class AboutBox internal partial class AboutBox
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View file

@ -26,9 +26,9 @@ namespace SystemTrayMenu.UserInterface
/// http://www.forestmoon.com /// http://www.forestmoon.com
/// . /// .
/// </remarks> /// </remarks>
public partial class AboutBox : Form internal partial class AboutBox : Form
{ {
private bool isPainted = false; private bool isPainted;
private string entryAssemblyName; private string entryAssemblyName;
private string callingAssemblyName; private string callingAssemblyName;
private string executingAssemblyName; private string executingAssemblyName;
@ -814,8 +814,7 @@ namespace SystemTrayMenu.UserInterface
int intResult = string.Compare( int intResult = string.Compare(
((ListViewItem)x).SubItems[intCol].Text, ((ListViewItem)x).SubItems[intCol].Text,
((ListViewItem)y).SubItems[intCol].Text, ((ListViewItem)y).SubItems[intCol].Text,
CultureInfo.InvariantCulture, StringComparison.Ordinal);
CompareOptions.None);
if (isAscending) if (isAscending)
{ {
return intResult; return intResult;

View file

@ -19,7 +19,7 @@ namespace SystemTrayMenu.UserInterface
private const int Interval60FPS = 16; // 60fps=>1s/60fps=~16.6ms private const int Interval60FPS = 16; // 60fps=>1s/60fps=~16.6ms
private readonly Timer load = new Timer(); private readonly Timer load = new Timer();
private readonly NotifyIcon notifyIcon = new NotifyIcon(); private readonly NotifyIcon notifyIcon = new NotifyIcon();
private readonly int indexLoad = 0; private readonly int indexLoad;
private readonly List<Icon> bitmapsLoading = new List<Icon>() private readonly List<Icon> bitmapsLoading = new List<Icon>()
{ {
R.L010, R.L020, R.L030, R.L010, R.L020, R.L030,
@ -28,8 +28,8 @@ namespace SystemTrayMenu.UserInterface
}; };
private DateTime timeLoadingStart; private DateTime timeLoadingStart;
private bool threadsLoading = false; private bool threadsLoading;
private int loadCount = 0; private int loadCount;
public AppNotifyIcon() public AppNotifyIcon()
{ {

View file

@ -128,7 +128,7 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog
} }
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
internal static extern int SHCreateItemFromParsingName( internal static extern int SHCreateItemFromParsingName(
[MarshalAs(UnmanagedType.LPWStr)] string pszPath, [MarshalAs(UnmanagedType.LPWStr)] string pszPath,
IntPtr pbc, IntPtr pbc,

View file

@ -18,8 +18,8 @@ namespace SystemTrayMenu.UserInterface
internal partial class Menu : Form internal partial class Menu : Form
{ {
private readonly Fading fading = new Fading(); private readonly Fading fading = new Fading();
private bool isShowing = false; private bool isShowing;
private bool directionToRight = false; private bool directionToRight;
internal Menu() internal Menu()
{ {
@ -155,7 +155,7 @@ namespace SystemTrayMenu.UserInterface
TopRight, TopRight,
} }
internal int Level { get; set; } = 0; internal int Level { get; set; }
internal bool IsUsable => Visible && !fading.IsHiding && internal bool IsUsable => Visible && !fading.IsHiding &&
!IsDisposed && !Disposing; !IsDisposed && !Disposing;

View file

@ -18,7 +18,7 @@ namespace SystemTrayMenu.UserInterface
public partial class SettingsForm : Form public partial class SettingsForm : Form
{ {
private readonly string newHotKey = string.Empty; private readonly string newHotKey = string.Empty;
private bool inHotkey = false; private bool inHotkey;
public SettingsForm() public SettingsForm()
{ {

View file

@ -12,9 +12,9 @@ namespace SystemTrayMenu.Utilities
internal static class FolderOptions internal static class FolderOptions
{ {
private static bool hideHiddenEntries = false; private static bool hideHiddenEntries;
private static bool hideSystemEntries = false; private static bool hideSystemEntries;
private static IShellDispatch4 iShellDispatch4 = null; private static IShellDispatch4 iShellDispatch4;
internal static void Initialize() internal static void Initialize()
{ {