winget-cli

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

ManifestLocalization.cs (5999B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="ManifestLocalization.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGetUtil.Models.V1
      8 {
      9     using System.Collections.Generic;
     10 
     11     /// <summary>
     12     /// Class that contains the elements that represent what a manifest localization element can contain in the manifest file.
     13     /// </summary>
     14     public class ManifestLocalization
     15     {
     16         /// <summary>
     17         /// Gets or sets the locale.
     18         /// </summary>
     19         public string PackageLocale { get; set; }
     20 
     21         /// <summary>
     22         /// Gets or sets the publisher.
     23         /// </summary>
     24         public string Publisher { get; set; }
     25 
     26         /// <summary>
     27         /// Gets or sets the publisher url.
     28         /// </summary>
     29         public string PublisherUrl { get; set; }
     30 
     31         /// <summary>
     32         /// Gets or sets the publisher support url.
     33         /// </summary>
     34         public string PublisherSupportUrl { get; set; }
     35 
     36         /// <summary>
     37         /// Gets or sets the default privacy url.
     38         /// </summary>
     39         public string PrivacyUrl { get; set; }
     40 
     41         /// <summary>
     42         /// Gets or sets the author.
     43         /// </summary>
     44         public string Author { get; set; }
     45 
     46         /// <summary>
     47         /// Gets or sets the package name.
     48         /// </summary>
     49         public string PackageName { get; set; }
     50 
     51         /// <summary>
     52         /// Gets or sets the package homepage url.
     53         /// </summary>
     54         public string PackageUrl { get; set; }
     55 
     56         /// <summary>
     57         /// Gets or sets the license.
     58         /// </summary>
     59         public string License { get; set; }
     60 
     61         /// <summary>
     62         /// Gets or sets the license url.
     63         /// </summary>
     64         public string LicenseUrl { get; set; }
     65 
     66         /// <summary>
     67         /// Gets or sets the copyright.
     68         /// </summary>
     69         public string Copyright { get; set; }
     70 
     71         /// <summary>
     72         /// Gets or sets the copyright url.
     73         /// </summary>
     74         public string CopyrightUrl { get; set; }
     75 
     76         /// <summary>
     77         /// Gets or sets the package short description.
     78         /// </summary>
     79         public string ShortDescription { get; set; }
     80 
     81         /// <summary>
     82         /// Gets or sets the package description.
     83         /// </summary>
     84         public string Description { get; set; }
     85 
     86         /// <summary>
     87         /// Gets or sets the Tags.
     88         /// </summary>
     89         public List<string> Tags { get; set; }
     90 
     91         /// <summary>
     92         /// Gets or sets the package agreements.
     93         /// </summary>
     94         public List<PackageAgreement> Agreements { get; set; }
     95 
     96         /// <summary>
     97         /// Gets or sets the release notes.
     98         /// </summary>
     99         public string ReleaseNotes { get; set; }
    100 
    101         /// <summary>
    102         /// Gets or sets the release notes url.
    103         /// </summary>
    104         public string ReleaseNotesUrl { get; set; }
    105 
    106         /// <summary>
    107         /// Gets or sets the purchase url of the package.
    108         /// </summary>
    109         public string PurchaseUrl { get; set; }
    110 
    111         /// <summary>
    112         /// Gets or sets the installation notes.
    113         /// </summary>
    114         public string InstallationNotes { get; set; }
    115 
    116         /// <summary>
    117         /// Gets or sets the manifest documentation.
    118         /// </summary>
    119         public List<ManifestDocumentation> Documentations { get; set; }
    120 
    121         /// <summary>
    122         /// Gets or sets the manifest icons information.
    123         /// </summary>
    124         public List<ManifestIcon> Icons { get; set; }
    125 
    126         /// <summary>
    127         /// Returns a List of strings containing the URIs contained within this localization.
    128         /// </summary>
    129         /// <returns>List of strings.</returns>
    130         public List<string> GetURIs()
    131         {
    132             List<string> uris = new List<string>();
    133             if (!string.IsNullOrEmpty(this.PublisherUrl))
    134             {
    135                 uris.Add(this.PublisherUrl);
    136             }
    137 
    138             if (!string.IsNullOrEmpty(this.PublisherSupportUrl))
    139             {
    140                 uris.Add(this.PublisherSupportUrl);
    141             }
    142 
    143             if (!string.IsNullOrEmpty(this.PrivacyUrl))
    144             {
    145                 uris.Add(this.PrivacyUrl);
    146             }
    147 
    148             if (!string.IsNullOrEmpty(this.PackageUrl))
    149             {
    150                 uris.Add(this.PackageUrl);
    151             }
    152 
    153             if (!string.IsNullOrEmpty(this.LicenseUrl))
    154             {
    155                 uris.Add(this.LicenseUrl);
    156             }
    157 
    158             if (!string.IsNullOrEmpty(this.CopyrightUrl))
    159             {
    160                 uris.Add(this.CopyrightUrl);
    161             }
    162 
    163             if (!string.IsNullOrEmpty(this.ReleaseNotesUrl))
    164             {
    165                 uris.Add(this.ReleaseNotesUrl);
    166             }
    167 
    168             if (this.Agreements != null)
    169             {
    170                 foreach (var agreement in this.Agreements)
    171                 {
    172                     if (!string.IsNullOrEmpty(agreement.AgreementUrl))
    173                     {
    174                         uris.Add(agreement.AgreementUrl);
    175                     }
    176                 }
    177             }
    178 
    179             if (this.Documentations != null)
    180             {
    181                 foreach (var docs in this.Documentations)
    182                 {
    183                     if (!string.IsNullOrEmpty(docs.DocumentUrl))
    184                     {
    185                         uris.Add(docs.DocumentUrl);
    186                     }
    187                 }
    188             }
    189 
    190             if (this.Icons != null)
    191             {
    192                 foreach (var icon in this.Icons)
    193                 {
    194                     if (!string.IsNullOrEmpty(icon.IconUrl))
    195                     {
    196                         uris.Add(icon.IconUrl);
    197                     }
    198                 }
    199             }
    200 
    201             return uris;
    202         }
    203     }
    204 }