public void ExecuteUserDoFunc(UserActionExecutionContext ctx)
 {
     if (doFunc != null)
     {
         ExecuteSafely(ctx, doFunc);
     }
 }
 public void ExecuteUserAfterFunc(UserActionExecutionContext ctx)
 {
     if (afterFunc != null)
     {
         ExecuteSafely(ctx, afterFunc);
     }
 }
 public void ExecuteUserBeforeFunc(UserActionExecutionContext ctx)
 {
     if (beforeFunc != null)
     {
         ExecuteSafely(ctx, beforeFunc);
     }
 }
 public bool EvaluateUserWhenFunc(UserActionExecutionContext ctx, Dictionary <DSL.Def.WhenFunc, bool> cache)
 {
     if (!cache.Keys.Contains(whenFunc))
     {
         cache[whenFunc] = EvaluateSafely(ctx, whenFunc);
     }
     return(cache[whenFunc]);
 }
 protected internal static void ExecuteSafely(UserActionExecutionContext ctx, DSL.Def.AfterFunc func)
 {
     try
     {
         func(ctx);
     }
     catch (Exception ex)
     {
         Debug.Print(
             "An exception was thrown when executing a AfterFunc of a gesture. " +
             "This error may automatically be recovered.\n{0} :\n{1}",
             ex.GetType().Name,
             ex.StackTrace);
     }
 }