public static IEnumerable <Offering> ActiveFlags(this Offering flag) { return(Enum.GetValues(typeof(Offering)) .Cast <Offering>() .Where(o => o != Offering.NONE && o != Offering.ALL && flag.HasFlag(o))); }
public static Offering FirstSemester(this Offering flag) { if (flag.HasFlag(Offering.FALL)) { return(Offering.FALL); } if (flag.HasFlag(Offering.WINTER)) { return(Offering.WINTER); } if (flag.HasFlag(Offering.SPRING)) { return(Offering.SPRING); } if (flag.HasFlag(Offering.SUMMER)) { return(Offering.SUMMER); } return(Offering.NONE); }