Merge models

This commit is contained in:
bao-qian
2016-08-20 01:17:28 +01:00
parent 0c0ec29821
commit ee542f0fec
13 changed files with 131 additions and 166 deletions

View File

@@ -2,25 +2,22 @@
using System.Collections.Generic;
using System.IO;
namespace Wox.Plugin.Program.ProgramSources
namespace Wox.Plugin.Program.Programs
{
[Serializable]
public class UnregisteredPrograms : Win32
{
public string Location { get; set; } = "";
public override List<Program> LoadPrograms()
public static List<Win32> All(List<Settings.ProgramSource> sources, string[] suffixes)
{
if (Directory.Exists(Location) && MaxDepth >= -1)
List<Win32> programs = new List<Win32>();
foreach (var source in sources)
{
var apps = new List<Program>();
GetAppFromDirectory(apps, Location, MaxDepth);
return apps;
}
else
{
return new List<Program>();
if (System.IO.Directory.Exists(source.Location) && source.MaxDepth >= -1)
{
GetAppFromDirectory(programs, source.Location, source.MaxDepth, suffixes);
}
}
return programs;
}
}
}