Skip to content

Commit fae1184

Browse files
LanYun2022Copilot
andauthored
Update ContextMenuManager/Controls/ShellList.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent dbbe2fa commit fae1184

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

ContextMenuManager/Controls/ShellList.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -454,22 +454,20 @@ private Image GetItemIcon(string regPath)
454454

455455
Icon icon;
456456
string iconPath;
457-
int iconIndex;
458-
457+
459458
if (iconLocation != null)
460459
{
461-
icon = ResourceIcon.GetIcon(iconLocation, out iconPath, out iconIndex);
460+
icon = ResourceIcon.GetIcon(iconLocation, out iconPath, out _);
462461
if (icon == null && Path.GetExtension(iconPath)?.ToLower() == ".exe")
463-
icon = ResourceIcon.GetIcon(iconPath = "imageres.dll", iconIndex = -15);
462+
icon = ResourceIcon.GetIcon("imageres.dll", -15);
464463
}
465464
else if (hasLUAShield)
466-
icon = ResourceIcon.GetIcon(iconPath = "imageres.dll", iconIndex = -78);
467-
else
468-
icon = ResourceIcon.GetIcon(iconPath = itemFilePath, iconIndex = 0);
469-
470-
if (icon == null)
471-
icon = ResourceIcon.GetExtensionIcon(itemFilePath) ?? ResourceIcon.GetIcon(iconPath = "imageres.dll", iconIndex = -2);
472-
465+
icon = ResourceIcon.GetIcon("imageres.dll", -78);
466+
else
467+
icon = ResourceIcon.GetIcon(itemFilePath, 0);
468+
469+
if (icon == null)
470+
icon = ResourceIcon.GetExtensionIcon(itemFilePath) ?? ResourceIcon.GetIcon("imageres.dll", -2);
473471
Image image = icon.ToBitmap();
474472
if (iconLocation == null && !hasLUAShield)
475473
{

0 commit comments

Comments
 (0)