public static IEnumerable <SongType> ToIndividualSelections(this SongTypes selections, bool skipUnspecified = false) { return(EnumVal <SongTypes> .GetIndividualValues(selections) .Where(t => !skipUnspecified || t != SongTypes.Unspecified) .Select(s => (SongType)s)); }
public static IEnumerable <ContentLanguageSelection> ToIndividualSelections(this ContentLanguageSelections selections) { return(EnumVal <ContentLanguageSelections> .GetIndividualValues(selections) .Where(s => s != ContentLanguageSelections.All) .Select(s => (ContentLanguageSelection)s)); }
/// <summary> /// Gets a list of individual values from bitarray. /// <see cref="ArtistTypes.Unknown"/> is skipped. /// </summary> /// <param name="flags">Bitarray of artist types.</param> /// <returns>Individual artist types.</returns> public static ArtistType[] GetArtistTypesFromFlags(ArtistTypes flags) { return(EnumVal <ArtistTypes> .GetIndividualValues(flags) .Where(v => v != ArtistTypes.Unknown) .Select(a => EnumVal <ArtistType> .Parse(a.ToString())) .ToArray()); }
public static IEnumerable <PurchaseStatus> ToIndividualSelections(this PurchaseStatuses selections) { if (selections == PurchaseStatuses.Nothing) { return new[] { PurchaseStatus.Nothing } } ; return(EnumVal <PurchaseStatuses> .GetIndividualValues(selections) .Where(s => s != PurchaseStatuses.All && s != PurchaseStatuses.Nothing) .Select(s => (PurchaseStatus)s)); } }
public static IEnumerable <PVService> ToIndividualSelections(this PVServices selections) { return(EnumVal <PVServices> .GetIndividualValues(selections) .Select(s => (PVService)s)); }