@@ -217,14 +217,6 @@ public static string ExtractStringFromDLL(string file, int number)
217
217
}
218
218
}
219
219
220
- private class IconAndOverlayCacheEntry
221
- {
222
- public byte [ ] ? Icon { get ; set ; }
223
-
224
- public byte [ ] ? Overlay { get ; set ; }
225
- }
226
-
227
- private static readonly ConcurrentDictionary < string , ConcurrentDictionary < int , IconAndOverlayCacheEntry > > _iconAndOverlayCache = new ( ) ;
228
220
229
221
private static readonly object _lock = new object ( ) ;
230
222
@@ -254,20 +246,6 @@ public static (byte[]? icon, byte[]? overlay, bool isIconCached) GetFileIconAndO
254
246
byte [ ] ? iconData = null , overlayData = null ;
255
247
bool isIconCached = false ;
256
248
257
- var entry = _iconAndOverlayCache . GetOrAdd ( path , _ => new ( ) ) ;
258
-
259
- if ( entry . TryGetValue ( thumbnailSize , out var cacheEntry ) )
260
- {
261
- iconData = cacheEntry . Icon ;
262
- overlayData = cacheEntry . Overlay ;
263
-
264
- if ( ( onlyGetOverlay && overlayData is not null ) ||
265
- ( ! getOverlay && iconData is not null ) ||
266
- ( overlayData is not null && iconData is not null ) )
267
- {
268
- return ( iconData , overlayData , true ) ;
269
- }
270
- }
271
249
272
250
try
273
251
{
@@ -386,14 +364,7 @@ public static (byte[]? icon, byte[]? overlay, bool isIconCached) GetFileIconAndO
386
364
}
387
365
finally
388
366
{
389
- cacheEntry = new IconAndOverlayCacheEntry ( ) ;
390
- if ( iconData is not null )
391
- cacheEntry . Icon = iconData ;
392
-
393
- if ( overlayData is not null )
394
- cacheEntry . Overlay = overlayData ;
395
367
396
- entry [ thumbnailSize ] = cacheEntry ;
397
368
}
398
369
}
399
370
@@ -525,8 +496,6 @@ public static bool SetCustomDirectoryIcon(string? folderPath, string? iconFile,
525
496
fcs . dwSize = ( uint ) Marshal . SizeOf ( fcs ) ;
526
497
527
498
var success = Shell32 . SHGetSetFolderCustomSettings ( ref fcs , folderPath , Shell32 . FCS . FCS_FORCEWRITE ) . Succeeded ;
528
- if ( success )
529
- _iconAndOverlayCache [ folderPath ] = new ( ) ;
530
499
531
500
return success ;
532
501
}
@@ -537,8 +506,6 @@ public static bool SetCustomFileIcon(string? filePath, string? iconFile, int ico
537
506
return false ;
538
507
539
508
var success = FileOperationsHelpers . SetLinkIcon ( filePath , iconFile , iconIndex ) ;
540
- if ( success )
541
- _iconAndOverlayCache [ filePath ] = new ( ) ;
542
509
543
510
return success ;
544
511
}
0 commit comments