Пример #1
0
 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)));
 }
Пример #2
0
 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);
 }