コード例 #1
0
ファイル: SongType.cs プロジェクト: AgFlore/vocadb
 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));
 }
コード例 #2
0
 public static IEnumerable <ContentLanguageSelection> ToIndividualSelections(this ContentLanguageSelections selections)
 {
     return(EnumVal <ContentLanguageSelections>
            .GetIndividualValues(selections)
            .Where(s => s != ContentLanguageSelections.All)
            .Select(s => (ContentLanguageSelection)s));
 }
コード例 #3
0
ファイル: ArtistHelper.cs プロジェクト: lordofire/vocadb
 /// <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());
 }
コード例 #4
0
        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));
        }
    }
コード例 #5
0
 public static IEnumerable <PVService> ToIndividualSelections(this PVServices selections)
 {
     return(EnumVal <PVServices>
            .GetIndividualValues(selections)
            .Select(s => (PVService)s));
 }