Deleting folders with custom icons no longer triggers system file warning
This commit is contained in:
parent
2b672f86be
commit
02371f2221
3 changed files with 66 additions and 69 deletions
|
|
@ -14,19 +14,9 @@ namespace WindowsConfigApp
|
|||
|
||||
public void SetFolderIcon(string image, string directory)
|
||||
{
|
||||
string iconPath = null;
|
||||
|
||||
try
|
||||
{
|
||||
var icon = Image.Load(image).ToIcon();
|
||||
new DirectoryInfo(directory)?.SetIcon(icon, "Music");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(iconPath))
|
||||
File.Delete(iconPath);
|
||||
}
|
||||
}
|
||||
var icon = Image.Load(image).ToIcon();
|
||||
new DirectoryInfo(directory)?.SetIcon(icon, "Music");
|
||||
}
|
||||
|
||||
public void DeleteFolderIcon(string directory)
|
||||
=> new DirectoryInfo(directory)?.DeleteIcon();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue