2019-10-18 07:53:00 +11:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2019-09-06 08:06:51 +10:00
|
|
|
|
using System.IO;
|
2015-01-05 22:41:17 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Wox.Plugin.Program
|
|
|
|
|
|
{
|
2016-04-21 01:53:21 +01:00
|
|
|
|
public class Settings
|
2015-01-05 22:41:17 +08:00
|
|
|
|
{
|
2019-10-18 08:16:07 +11:00
|
|
|
|
public DateTime LastIndexTime { get; set; }
|
2016-08-20 01:17:28 +01:00
|
|
|
|
public List<ProgramSource> ProgramSources { get; set; } = new List<ProgramSource>();
|
2019-10-15 08:05:21 +11:00
|
|
|
|
public List<DisabledProgramSource> DisabledProgramSources { get; set; } = new List<DisabledProgramSource>();
|
2016-04-21 01:53:21 +01:00
|
|
|
|
public string[] ProgramSuffixes { get; set; } = {"bat", "appref-ms", "exe", "lnk"};
|
2015-01-05 22:41:17 +08:00
|
|
|
|
|
2016-04-21 01:53:21 +01:00
|
|
|
|
public bool EnableStartMenuSource { get; set; } = true;
|
2016-03-28 03:09:57 +01:00
|
|
|
|
|
2016-04-21 01:53:21 +01:00
|
|
|
|
public bool EnableRegistrySource { get; set; } = true;
|
2016-08-19 20:34:20 +01:00
|
|
|
|
|
|
|
|
|
|
internal const char SuffixSeperator = ';';
|
2016-08-20 01:17:28 +01:00
|
|
|
|
|
2019-09-10 07:57:03 +10:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Contains user added folder location contents as well as all user disabled applications
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
2019-10-16 22:38:44 +11:00
|
|
|
|
/// <para>Win32 class applications set UniqueIdentifier using their full file path</para>
|
|
|
|
|
|
/// <para>UWP class applications set UniqueIdentifier using their Application User Model ID</para>
|
|
|
|
|
|
/// <para>Custom user added program sources set UniqueIdentifier using their location</para>
|
2019-09-10 07:57:03 +10:00
|
|
|
|
/// </remarks>
|
2016-08-20 01:17:28 +01:00
|
|
|
|
public class ProgramSource
|
|
|
|
|
|
{
|
2019-09-06 08:06:51 +10:00
|
|
|
|
private string name;
|
|
|
|
|
|
|
2016-08-20 01:17:28 +01:00
|
|
|
|
public string Location { get; set; }
|
2019-09-06 08:06:51 +10:00
|
|
|
|
public string Name { get => name ?? new DirectoryInfo(Location).Name; set => name = value; }
|
|
|
|
|
|
public bool Enabled { get; set; } = true;
|
2019-09-10 07:57:03 +10:00
|
|
|
|
public string UniqueIdentifier { get; set; }
|
2016-08-20 01:17:28 +01:00
|
|
|
|
}
|
2019-10-15 08:05:21 +11:00
|
|
|
|
|
2019-10-15 20:22:20 +11:00
|
|
|
|
public class DisabledProgramSource : ProgramSource { }
|
2015-01-05 22:41:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|