mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 11:17:53 +01:00
[Projects] Removing not selected apps on save
This commit is contained in:
@@ -158,10 +158,17 @@ namespace ProjectsEditor.ViewModels
|
||||
editedProject.Name = projectToSave.Name;
|
||||
editedProject.IsShortcutNeeded = projectToSave.IsShortcutNeeded;
|
||||
editedProject.PreviewImage = projectToSave.PreviewImage;
|
||||
for (int appIndex = 0; appIndex < editedProject.Applications.Count; appIndex++)
|
||||
for (int appIndex = editedProject.Applications.Count - 1; appIndex >= 0; appIndex--)
|
||||
{
|
||||
editedProject.Applications[appIndex].IsSelected = projectToSave.Applications[appIndex].IsSelected;
|
||||
editedProject.Applications[appIndex].CommandLineArguments = projectToSave.Applications[appIndex].CommandLineArguments;
|
||||
if (!projectToSave.Applications[appIndex].IsSelected)
|
||||
{
|
||||
editedProject.Applications.RemoveAt(appIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
editedProject.Applications[appIndex].IsSelected = true;
|
||||
editedProject.Applications[appIndex].CommandLineArguments = projectToSave.Applications[appIndex].CommandLineArguments;
|
||||
}
|
||||
}
|
||||
|
||||
editedProject.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("AppsCountString"));
|
||||
|
||||
Reference in New Issue
Block a user