| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="SmartEnumDisplayTextStrategy.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System.Globalization; |
| | | 8 | | using MyNet.Globalization.Localization.Translation; |
| | | 9 | | using MyNet.Globalization.Localization.Translation.KeyGeneration; |
| | | 10 | | using MyNet.Primitives; |
| | | 11 | | |
| | | 12 | | namespace MyNet.Humanizer.Display.Strategies; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Provides display names for SmartEnum values, using a translation service to support localization. It first attempts |
| | | 16 | | /// </summary> |
| | | 17 | | /// <param name="translationService">The translation service used to localize the display names.</param> |
| | | 18 | | /// <param name="keyProvider">The key provider to use for generating translation keys.</param> |
| | 8 | 19 | | public sealed class SmartEnumDisplayTextStrategy(ITranslationService translationService, ITranslationKeyProvider keyProv |
| | | 20 | | { |
| | | 21 | | /// <inheritdoc/> |
| | 0 | 22 | | protected override string? ProvideSymbol(ISmartEnum value, CultureInfo culture) => null; |
| | | 23 | | |
| | | 24 | | /// <inheritdoc/> |
| | 12 | 25 | | protected override string? ProvideDisplayText(ISmartEnum value, CultureInfo culture) => null; |
| | | 26 | | |
| | | 27 | | /// <inheritdoc/> |
| | 12 | 28 | | protected override string ProvideFallback(ISmartEnum value, CultureInfo culture) => value.Name; |
| | | 29 | | } |
| | | 30 | | |