public static string AsDisplayString(this FilterDocumentType documentType) { var result = documentType.GetAttributeOfType <DisplayAttribute>(); if (result != null && !string.IsNullOrEmpty(result.Name)) { return(result.Name); } return(documentType.ToString()); }
public static string GetIcon(FilterDocumentType documentType) { switch (documentType) { case FilterDocumentType.AnalogueTachograph: return("https://www.webcalconnect.com/img/AnalogueTacho.png"); case FilterDocumentType.Tachograph: return("https://www.webcalconnect.com/img/DigitalTacho.png"); case FilterDocumentType.Undownloadability: return("https://www.webcalconnect.com/img/Undownloadability.png"); case FilterDocumentType.LetterForDecommissioning: return("https://www.webcalconnect.com/img/LetterForDecomm.png"); default: throw new ArgumentOutOfRangeException(nameof(documentType), documentType, null); } }