Remove enable property from model

This commit is contained in:
bao-qian
2016-08-19 19:16:06 +01:00
parent d09c42366a
commit fb68f6eb60
4 changed files with 9 additions and 22 deletions

View File

@@ -150,27 +150,17 @@ namespace Wox.Plugin.Program
private static List<ProgramSource> ProgramSources()
{
var sources = new List<ProgramSource>
var sources = new List<ProgramSource>();
if (_settings.EnableStartMenuSource)
{
new CommonStartMenuProgramSource
{
Enabled = _settings.EnableStartMenuSource,
},
new UserStartMenuProgramSource
{
Enabled = _settings.EnableStartMenuSource,
},
new AppPathsProgramSource
{
Enabled = _settings.EnableRegistrySource,
}
};
if (_settings.ProgramSources.Count(o => o.Enabled) > 0)
{
sources.AddRange(_settings.ProgramSources);
sources.Add(new CommonStartMenuProgramSource());
sources.Add(new UserStartMenuProgramSource());
}
if (_settings.EnableRegistrySource)
{
sources.Add(new AppPathsProgramSource());
}
sources.AddRange(_settings.ProgramSources);
return sources;
}