mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Merge branch 'enable_userselected_programloading' into dev
This commit is contained in:
@@ -1,11 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using Wox.Infrastructure;
|
|
||||||
using Wox.Infrastructure.Logger;
|
using Wox.Infrastructure.Logger;
|
||||||
using Wox.Infrastructure.Storage;
|
using Wox.Infrastructure.Storage;
|
||||||
using Wox.Plugin.Program.Programs;
|
using Wox.Plugin.Program.Programs;
|
||||||
@@ -162,21 +160,24 @@ namespace Wox.Plugin.Program
|
|||||||
return menuOptions;
|
return menuOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisableProgram(IProgram ProgramToDelete)
|
private void DisableProgram(IProgram programToDelete)
|
||||||
{
|
{
|
||||||
if(_uwps.Any(x => x.UniqueIdentifier == ProgramToDelete.UniqueIdentifier))
|
if (_settings.DisabledProgramSources.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||||
_uwps.Where(x => x.UniqueIdentifier == ProgramToDelete.UniqueIdentifier).FirstOrDefault().Enabled = false;
|
return;
|
||||||
|
|
||||||
if (_win32s.Any(x => x.UniqueIdentifier == ProgramToDelete.UniqueIdentifier))
|
if (_uwps.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||||
_win32s.Where(x => x.UniqueIdentifier == ProgramToDelete.UniqueIdentifier).FirstOrDefault().Enabled = false;
|
_uwps.Where(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier).FirstOrDefault().Enabled = false;
|
||||||
|
|
||||||
|
if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||||
|
_win32s.Where(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier).FirstOrDefault().Enabled = false;
|
||||||
|
|
||||||
_settings.DisabledProgramSources
|
_settings.DisabledProgramSources
|
||||||
.Add(
|
.Add(
|
||||||
new Settings.DisabledProgramSource
|
new Settings.DisabledProgramSource
|
||||||
{
|
{
|
||||||
Name = ProgramToDelete.Name,
|
Name = programToDelete.Name,
|
||||||
Location = ProgramToDelete.Location,
|
Location = programToDelete.Location,
|
||||||
UniqueIdentifier = ProgramToDelete.UniqueIdentifier,
|
UniqueIdentifier = programToDelete.UniqueIdentifier,
|
||||||
Enabled = false
|
Enabled = false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user