コード例 #1
0
 public static void GetRelative(RecurrenceRule obj, MethodReturnEventArgs<DateTime> e, DateTime dt)
 {
     if (obj.Count.HasValue == false)
     {
         e.Result = obj.GetNext(dt, dt);
     }
     else if (obj.Count == 1)
     {
         throw new InvalidOperationException("count cannot be 1, would return dt");
     }
     else
     {
         var result = dt;
         for (int i = 0; i < obj.Count; i++)
         {
             result = obj.GetNext(result, result);
         }
         e.Result = result;
     }
 }
コード例 #2
0
 public static void GetNext(RecurrenceRule obj, MethodReturnEventArgs<DateTime> e, DateTime start)
 {
     e.Result = obj.GetNext(start, DateTime.Now);
 }