winget-cli

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

Helpers.cs (1333B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="Helpers.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGetUtil.Common
      8 {
      9     using YamlDotNet.Serialization;
     10     using YamlDotNet.Serialization.NamingConventions;
     11 
     12     /// <summary>
     13     /// Helpers.
     14     /// </summary>
     15     internal static class Helpers
     16     {
     17         /// <summary>
     18         /// Helper to deserialize the manifest.
     19         /// </summary>
     20         /// <returns>IDeserializer object.</returns>
     21         public static IDeserializer CreateDeserializer()
     22         {
     23             return new DeserializerBuilder()
     24                 .WithNamingConvention(PascalCaseNamingConvention.Instance)
     25                 .IgnoreUnmatchedProperties()
     26                 .Build();
     27         }
     28 
     29         /// <summary>
     30         /// Helper to serialize the manifest.
     31         /// </summary>
     32         /// <returns>ISerializer object.</returns>
     33         public static ISerializer CreateSerializer()
     34         {
     35             return new SerializerBuilder()
     36                 .WithNamingConvention(PascalCaseNamingConvention.Instance)
     37                 .Build();
     38         }
     39     }
     40 }