mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 20:19:17 +08:00
19617e9dae
1. refactoriong start menu source 2. fix depth problems involved in last commit
29 lines
728 B
C#
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>();
|
|
}
|
|
}
|
|
}
|
|
} |