Files
PowerToys/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs

29 lines
728 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.IO;
2014-03-30 11:16:44 +08:00
using System.Linq;
2015-11-09 01:32:33 +00:00
using Wox.Infrastructure.Exception;
2015-10-30 23:17:34 +00:00
using Wox.Infrastructure.Logger;
namespace Wox.Plugin.Program.ProgramSources
{
[Serializable]
public class FileSystemProgramSource : Win32
{
public string Location { get; set; } = "";
public override List<Program> LoadPrograms()
{
2016-08-19 20:34:20 +01:00
if (Directory.Exists(Location) && MaxDepth >= -1)
{
2016-08-19 20:34:20 +01:00
var apps = new List<Program>();
GetAppFromDirectory(apps, Location, MaxDepth);
2016-08-19 20:34:20 +01:00
return apps;
}
else
{
return new List<Program>();
}
}
}
}