Exemple #1
0
        public ActionResult Index(string name = "", string op = "")
        {
            return(base.ExecuteFunction("Index", delegate()
            {
                string message = string.Empty;
                IDaemonManager daemonManager = this.IFoundation.GetDaemonManager();
                if (op == "removeall")
                {
                    daemonManager.UnRegisterAllDaemons();
                    message = "RemovedAll";
                }
                else if (op == "remove")
                {
                    daemonManager.UnRegisterDaemon(name);
                    message = "Removed: " + name;
                }
                else if (op == "stop")
                {
                    daemonManager.StopDaemon(name);
                    message = "Stopped: " + name;
                }
                else if (op == "start")
                {
                    daemonManager.StartDaemon(name);
                    message = "Started: " + name;
                }

                ViewBag.Message = message;
                return View(daemonManager.GetAllTimerDetails().OrderBy(x => x.Name).ToList());
            }));
        }