winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

PSSourceResult.cs (1944B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="PSSourceResult.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGet.Client.Engine.PSObjects
      8 {
      9     /// <summary>
     10     /// SourceResult wrapper object for displaying to PowerShell.
     11     /// </summary>
     12     public sealed class PSSourceResult
     13     {
     14         /// <summary>
     15         /// Initializes a new instance of the <see cref="PSSourceResult"/> class.
     16         /// </summary>
     17         /// <param name="catalogReference">The PackageCatalogReference COM object.</param>
     18         internal PSSourceResult(Management.Deployment.PackageCatalogReference catalogReference)
     19         {
     20             var info = catalogReference.Info;
     21             this.Name = info.Name;
     22             this.Argument = info.Argument;
     23             this.Type = info.Type;
     24             this.TrustLevel = info.TrustLevel.ToString();
     25             this.Explicit = info.Explicit;
     26         }
     27 
     28         /// <summary>
     29         /// Gets the name of the source.
     30         /// </summary>
     31         public string Name { get; private set; }
     32 
     33         /// <summary>
     34         /// Gets the argument of the source.
     35         /// </summary>
     36         public string Argument { get; private set; }
     37 
     38         /// <summary>
     39         /// Gets the type of the source.
     40         /// </summary>
     41         public string Type { get; private set; }
     42 
     43         /// <summary>
     44         /// Gets the trust level of the source.
     45         /// </summary>
     46         public string TrustLevel { get; private set; }
     47 
     48         /// <summary>
     49         /// Gets a value indicating whether the source must be explicitly specified for discovery.
     50         /// </summary>
     51         public bool Explicit { get; private set; }
     52     }
     53 }