/// <summary> /// Executes on Each Loop /// </summary> /// <param name="context"></param> /// <param name="completedInstance"></param> private void LoopExecution(NativeActivityContext context, ActivityInstance completedInstance) { LoopValue.Set(context, LoopValue.Get(context) + Addition.Get(context)); if ((Addition.Get(context) > 0) ? (To.Get(context) >= LoopValue.Get(context)) : (To.Get(context) <= LoopValue.Get(context))) { context.ScheduleAction <Int32>(Loop, LoopValue.Get(context), LoopExecution, null); } }
/// <summary> /// Execution Main /// </summary> /// <param name="context"></param> protected override void Execute(NativeActivityContext context) { if (Addition.Get(context) == 0) { throw new ArgumentException("[Addition] must not Zero"); } if (Addition.Get(context) > 0 ^ From.Get(context) < To.Get(context)) { throw new ArgumentException("Invalid [From] and [To]"); } if (Loop != null) { LoopValue.Set(context, From.Get(context)); context.ScheduleAction <Int32>(Loop, LoopValue.Get(context), LoopExecution, null); } }