PowerToys/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs
bao-qian 19617e9dae Refactoring start menu source
1. refactoriong start menu source
2. fix depth problems involved in last commit
2016-08-19 23:05:59 +01:00

29 lines
728 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
namespace Wox.Plugin.Program.ProgramSources
{
[Serializable]
public class FileSystemProgramSource : Win32
{
public string Location { get; set; } = "";
public override List<Program> LoadPrograms()
{
if (Directory.Exists(Location) && MaxDepth >= -1)
{
var apps = new List<Program>();
GetAppFromDirectory(apps, Location, MaxDepth);
return apps;
}
else
{
return new List<Program>();
}
}
}
}