| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="ListFormattingOptionsPresets.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | namespace MyNet.Humanizer.Formatting.Collections; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Common presets for list formatting without changing global defaults. |
| | | 11 | | /// </summary> |
| | | 12 | | public static class ListFormattingOptionsPresets |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Gets comma-separated list without conjunction ("a, b, c"). |
| | | 16 | | /// </summary> |
| | 3 | 17 | | public static ListFormattingOptions CommaSeparated { get; } = new() |
| | 3 | 18 | | { |
| | 3 | 19 | | Separator = ", ", |
| | 3 | 20 | | Conjunction = ListConjunction.None, |
| | 3 | 21 | | TrimItems = true, |
| | 3 | 22 | | IgnoreNullOrWhiteSpace = true |
| | 3 | 23 | | }; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Gets natural language list using conjunctions ("a, b and c"). |
| | | 27 | | /// </summary> |
| | 3 | 28 | | public static ListFormattingOptions NaturalLanguage { get; } = new() |
| | 3 | 29 | | { |
| | 3 | 30 | | Separator = ", ", |
| | 3 | 31 | | Conjunction = ListConjunction.And, |
| | 3 | 32 | | TrimItems = true, |
| | 3 | 33 | | IgnoreNullOrWhiteSpace = true |
| | 3 | 34 | | }; |
| | | 35 | | } |
| | | 36 | | |