public void InvokeAction(ControllerContext controllerContext, string actionName)
  {
      MethodInfo method = controllerContext.Controller.GetType().GetMethod(actionName);
      List<object> parameters = new List<object>();
      object taskData;
      controllerContext.RequestContext.RouteData.Values.TryGetValue("taskData", out taskData);
 
      parameters.Add(taskData);
      ActionResult actionResult = method.Invoke(controllerContext.Controller,parameters.ToArray()) as ActionResult;
      actionResult.ExecuteResult(controllerContext);
  
  }
Exemple #2
0
        public override void ExecuteResult(ControllerContext context)
        {
            DispathMessage returnMessage = new DispathMessage();
            returnMessage.ControllerName = context.RequestContext.RouteData.Controller;
            returnMessage.ActionName = context.RequestContext.RouteData.ActionName;
            returnMessage.TaskID = context.RequestContext.RouteData.TaskID;
            returnMessage.TaskData = RemainTaskData;
            if (string.IsNullOrEmpty(RemainTaskData))
            {
                returnMessage.MachineInvokeStatus = MachineInvokeStatus.Completed;
            }
            else
            {
                returnMessage.MachineInvokeStatus = MachineInvokeStatus.PartCompleted;
            }

           
            context.RequestContext.RemainDispathUrlMessage = returnMessage;
        }
Exemple #3
0
 public void Execute(RequestContext requestContext)
 {
     ControllerContext context = new ControllerContext { RequestContext = requestContext, Controller = this };
     string actionName = requestContext.RouteData.ActionName;
     this.ActionInvoker.InvokeAction(context, actionName);
 }
Exemple #4
0
 public abstract void ExecuteResult(ControllerContext context);