PowerToys/Plugins/Wox.Plugin.Program/Settings.cs

47 lines
1.7 KiB
C#
Raw Normal View History

2016-08-20 06:24:21 +08:00
using System.Collections.Generic;
2019-09-06 06:06:51 +08:00
using System.IO;
2016-08-20 08:17:28 +08:00
using Wox.Plugin.Program.Programs;
namespace Wox.Plugin.Program
{
public class Settings
{
2016-08-20 08:17:28 +08:00
public List<ProgramSource> ProgramSources { get; set; } = new List<ProgramSource>();
public List<DisabledProgramSource> DisabledProgramSources { get; set; } = new List<DisabledProgramSource>();
public string[] ProgramSuffixes { get; set; } = {"bat", "appref-ms", "exe", "lnk"};
public bool EnableStartMenuSource { get; set; } = true;
public bool EnableRegistrySource { get; set; } = true;
2016-08-20 03:34:20 +08:00
internal const char SuffixSeperator = ';';
2016-08-20 08:17:28 +08:00
/// <summary>
/// Contains user added folder location contents as well as all user disabled applications
/// </summary>
/// <remarks>
/// <para>Win32 class applications sets UniqueIdentifier using their full path</para>
/// <para>UWP class applications sets UniqueIdentifier using their Application User Model ID</para>
/// </remarks>
2016-08-20 08:17:28 +08:00
public class ProgramSource
{
2019-09-06 06:06:51 +08:00
private string name;
2016-08-20 08:17:28 +08:00
public string Location { get; set; }
2019-09-06 06:06:51 +08:00
public string Name { get => name ?? new DirectoryInfo(Location).Name; set => name = value; }
public bool Enabled { get; set; } = true;
public string UniqueIdentifier { get; set; }
2016-08-20 08:17:28 +08:00
}
public class DisabledProgramSource
{
private string name;
public string Location { get; set; }
public string Name { get => name ?? new DirectoryInfo(Location).Name; set => name = value; }
public bool Enabled { get; set; } = true;
public string UniqueIdentifier { get; set; }
}
}
}