mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
Delete icon on workspace removal
This commit is contained in:
@@ -348,10 +348,27 @@ namespace WorkspacesEditor.ViewModels
|
||||
{
|
||||
Workspaces.Remove(selectedProject);
|
||||
_workspacesEditorIO.SerializeWorkspaces(Workspaces.ToList());
|
||||
RemoveShortcut(selectedProject);
|
||||
OnPropertyChanged(new PropertyChangedEventArgs(nameof(WorkspacesView)));
|
||||
SendDeleteTelemetryEvent();
|
||||
}
|
||||
|
||||
private void RemoveShortcut(Project selectedProject)
|
||||
{
|
||||
string shortcutAddress = Path.Combine(FolderUtils.Desktop(), selectedProject.Name + ".lnk");
|
||||
string shortcutIconFilename = Path.Combine(FolderUtils.Temp(), selectedProject.Id + ".ico");
|
||||
|
||||
if (File.Exists(shortcutIconFilename))
|
||||
{
|
||||
File.Delete(shortcutIconFilename);
|
||||
}
|
||||
|
||||
if (File.Exists(shortcutAddress))
|
||||
{
|
||||
File.Delete(shortcutAddress);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetMainWindow(MainWindow mainWindow)
|
||||
{
|
||||
_mainWindow = mainWindow;
|
||||
|
||||
Reference in New Issue
Block a user