ProgramSource.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using System.IO.Abstractions;
 6  
 7  namespace Microsoft.Plugin.Program
 8  {
 9      /// <summary>
10      /// Contains user added folder location contents as well as all user disabled applications
11      /// </summary>
12      /// <remarks>
13      /// <para>Win32 class applications set UniqueIdentifier using their full file path</para>
14      /// <para>UWP class applications set UniqueIdentifier using their Application User Model ID</para>
15      /// <para>Custom user added program sources set UniqueIdentifier using their location</para>
16      /// </remarks>
17      public class ProgramSource
18      {
19          private static readonly IFileSystem FileSystem = new FileSystem();
20  
21          private string name;
22  
23          public string Location { get; set; }
24  
25          public string Name { get => name ?? FileSystem.DirectoryInfo.New(Location).Name; set => name = value; }
26  
27          public bool Enabled { get; set; } = true;
28  
29          public string UniqueIdentifier { get; set; }
30      }
31  }