public bool TryGetExtensibleEnumValueDisplayName(IExtensibleEnum value, out string result) { ArgumentUtility.CheckNotNull("value", value); var resourceType = value.GetValueInfo().DefiningMethod.DeclaringType; var resourceManager = _globalizationService.GetResourceManager(TypeAdapter.Create(resourceType)); return(resourceManager.TryGetString(value.ID, out result)); }
public bool TryGetExtensibleEnumValueDisplayName(IExtensibleEnum value, out string result) { ArgumentUtility.CheckNotNull("value", value); var extensibleEnumInfo = value.GetValueInfo(); Assertion.IsNotNull(extensibleEnumInfo, "No value info found for extensible enum '{0}'.", value.ID); var definingMethod = extensibleEnumInfo.DefiningMethod; Assertion.IsNotNull(definingMethod, "No defining method found for extensible enum '{0}'.", value.ID); return(_localizedNameForEnumerationProvider.TryGetLocalizedNameForCurrentUICulture(definingMethod, out result)); }
private bool IsEnabled(ExtensibleEnumerationProperty propertyWithFilteredType, IExtensibleEnum value) { return(propertyWithFilteredType.CreateEnumerationValueInfo(value.GetValueInfo(), null).IsEnabled); }