예제 #1
0
        public static List <WeeksOfMonth> GetValues(this WeeksOfMonth Flags)
        {
            var ret = new List <WeeksOfMonth>();

            foreach (var item in Order)
            {
                if (Flags.HasFlag(item))
                {
                    ret.Add(item);
                }
            }

            return(ret);
        }
예제 #2
0
        public static bool Matches(this WeeksOfMonth Frequency, DateTime Date)
        {
            var ret = false;

            var Number          = Date.Day - 1;
            var ActualFrequency = Order[Number / 7];

            ret = Frequency.HasFlag(ActualFrequency);

            if (Frequency.HasFlag(WeeksOfMonth.Last))
            {
                var NextWeek = Date.AddDays(7);
                if (NextWeek.Month != Date.Month)
                {
                    ret = true;
                }
            }

            return(ret);
        }
 public static T On <T>(this T Composite, WeeksOfMonth WeeksOfTheMonth) where T : IContainsConditions
 {
     Composite.Conditions <WeeksOfTheMonthCondition>().Add(WeeksOfTheMonth);
     return(Composite);
 }
 public void Remove(WeeksOfMonth WeeksOfTheMonth)
 {
     this.WeeksOfTheMonth &= ~WeeksOfTheMonth;
 }
 public void Add(WeeksOfMonth WeeksOfTheMonth)
 {
     this.WeeksOfTheMonth |= WeeksOfTheMonth;
 }
 public WeeksOfTheMonthCondition(WeeksOfMonth WeekOfMonth)
 {
     this.WeeksOfTheMonth = WeekOfMonth;
 }
 public WeeksOfTheMonthCondition()
 {
     this.WeeksOfTheMonth = WeeksOfMonth.None;
 }