SharpIconOverlayHandler is unable to refresh file icon from without an icon status.
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 266
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 1
Description
Version of SharpShell used: 2.7.1.0
OS: win7 64bit.
I am facing an issue that some files do not have an icon before, after some condition triggered make them should have an icon. but i have to click 'F5' or right click mouse to see the icon. I want to know if this great library have an approch or method to trigger the refresh action in code, because we can not tell our user to click 'F5' to refresh.
See below simple code,
Just modified this method witch is based on the git overlay simple, the 'C:\Config.txt' have some file names whitch need to show the icon. After return true, i have to click 'F5' to see the icon.
protected override bool CanShowOverlay(string path, FILE_ATTRIBUTE attributes)
{
try
{
var fileReadonly = File.ReadAllLines(@"C:\Config.txt");
if (fileReadonly.Contains(path))
{
return true;
}
else
{
return false;
}
//// Get the file attributes.
//var fileAttributes = new FileInfo(path);
//// Return true if the file is read only, meaning we'll show the overlay.
//return fileAttributes.IsReadOnly;
}
catch (Exception)
{
return false;
}
}
Contributor guide
Research direction
Start at SharpIconOverlayHandler.CanShowOverlay and trace how SharpShell registers and refreshes shell overlay results. Check whether the library exposes an entry point for notifying Windows Explorer after the configured file list changes. Done means the overlay appears without requiring the user to press F5 or right-click; no test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100