Revert "Improving performance of Adding and Removing Packaged Apps" (#4898)

* Revert "Adding newline to end of file for IProgramRepository"

This reverts commit d55cac80bf.

* Revert "Fixing comments"

This reverts commit a1ecdc9bfa.

* Revert "Restoring checks for invalid uwp apps based on PR feedback. This was accidentally removed when moving the initialize outside the constructor."

This reverts commit 0e8c1cb0fd.

* Revert "Removing unecessary implementation of IRepository interface as this is implemented by the base class."

This reverts commit 1c724280f5.

* Revert "Fixing potential race condition in ListRepository.  Now internally implemented as a concurrent dictionary."

This reverts commit 9ff8246a9d.

* Revert "Updating packagerepository comment based on pr feedback"

This reverts commit 2c45956030.

* Revert "Changing test structure.  Need to add unit tests."

This reverts commit 1c267a55d5.

* Revert "Fixing message format for exception"

This reverts commit f60bdc3dd4.

* Revert "Merging in Theme changes and moving win32Tests to Microsoft.Plugin.Program.UnitTests"

This reverts commit 030dfc2370.
This commit is contained in:
ryanbodrug-microsoft
2020-07-09 12:10:48 -07:00
committed by GitHub
parent b13e719ab3
commit 12d9d59d85
18 changed files with 734 additions and 1137 deletions

View File

@@ -61,6 +61,20 @@ namespace Microsoft.Plugin.Program.Views.Commands
Enabled = t1.Enabled
}
));
Main._uwps
.Where(t1 => !ProgramSetting.ProgramSettingDisplayList.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier))
.ToList()
.ForEach(t1 => ProgramSetting.ProgramSettingDisplayList
.Add(
new ProgramSource
{
Name = t1.DisplayName,
Location = t1.Package.Location,
UniqueIdentifier = t1.UniqueIdentifier,
Enabled = t1.Enabled
}
));
}
internal static void SetProgramSourcesStatus(this List<ProgramSource> list, List<ProgramSource> selectedProgramSourcesToDisable, bool status)
@@ -74,6 +88,11 @@ namespace Microsoft.Plugin.Program.Views.Commands
.Where(t1 => selectedProgramSourcesToDisable.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier && t1.Enabled != status))
.ToList()
.ForEach(t1 => t1.Enabled = status);
Main._uwps
.Where(t1 => selectedProgramSourcesToDisable.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier && t1.Enabled != status))
.ToList()
.ForEach(t1 => t1.Enabled = status);
}
internal static void StoreDisabledInSettings(this List<ProgramSource> list)
@@ -114,7 +133,7 @@ namespace Microsoft.Plugin.Program.Views.Commands
internal static bool IsReindexRequired(this List<ProgramSource> selectedItems)
{
if (selectedItems.Where(t1 => t1.Enabled).Count() > 0
if (selectedItems.Where(t1 => t1.Enabled && !Main._uwps.Any(x => t1.UniqueIdentifier == x.UniqueIdentifier)).Count() > 0
&& selectedItems.Where(t1 => t1.Enabled && !Main._win32s.Any(x => t1.UniqueIdentifier == x.UniqueIdentifier)).Count() > 0)
return true;

View File

@@ -51,6 +51,7 @@ namespace Microsoft.Plugin.Program.Views
Task.Run(() =>
{
Dispatcher.Invoke(() => { indexingPanel.Visibility = Visibility.Visible; });
Main.IndexPrograms();
Dispatcher.Invoke(() => { indexingPanel.Visibility = Visibility.Hidden; });
});
}