/// <summary> /// Checks whether a human-readable enumeration name of the spefified reflection object exists. /// </summary> /// <param name="enumerationGlobalizationService"> /// The <see cref="IEnumerationGlobalizationService"/> to use during the lookup. Must not be <see langword="null" />. /// </param> /// <param name="value"> /// The <see cref="Enum"/> that defines the name for the resource lookup. Must not be <see langword="null" />. /// </param> /// <returns><see langword="true" /> if a resource could be found.</returns> public static bool ContainsEnumerationValueDisplayName( [NotNull] this IEnumerationGlobalizationService enumerationGlobalizationService, [NotNull] Enum value) { ArgumentUtility.CheckNotNull("enumerationGlobalizationService", enumerationGlobalizationService); ArgumentUtility.CheckNotNull("value", value); string result; return(enumerationGlobalizationService.TryGetEnumerationValueDisplayName(value, out result)); }
public static string GetEnumerationValueDisplayNameOrDefault( [NotNull] this IEnumerationGlobalizationService enumerationGlobalizationService, [NotNull] Enum value) { ArgumentUtility.CheckNotNull("enumerationGlobalizationService", enumerationGlobalizationService); ArgumentUtility.CheckNotNull("value", value); string result; if (enumerationGlobalizationService.TryGetEnumerationValueDisplayName(value, out result)) { return(result); } return(null); }