mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-17 19:02:27 +12:00
Using cached icon instead of loading it multiple times from resources
This prevents a potential crash if lots of icons cannot be loaded (see https://stackoverflow.com/questions/36446000/system-reflection-targetinvocationexception-in-resources-designer-vb ) Fixes #159
This commit is contained in:
parent
d894277d00
commit
2cea00c942
|
@ -22,6 +22,7 @@ namespace SystemTrayMenu.DataClasses
|
|||
|
||||
internal class RowData : IDisposable
|
||||
{
|
||||
private static readonly Icon White50PercentageIcon = Properties.Resources.WhiteTransparency;
|
||||
private static DateTime contextMenuClosed;
|
||||
private string workingDirectory;
|
||||
private string arguments;
|
||||
|
@ -76,14 +77,14 @@ namespace SystemTrayMenu.DataClasses
|
|||
|
||||
if (icon == null)
|
||||
{
|
||||
icon = Properties.Resources.WhiteTransparency;
|
||||
icon = White50PercentageIcon;
|
||||
}
|
||||
|
||||
if (HiddenEntry)
|
||||
{
|
||||
row[0] = IconReader.AddIconOverlay(
|
||||
data.icon,
|
||||
Properties.Resources.WhiteTransparency);
|
||||
White50PercentageIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue