Пример #1
0
        public ActionResult Delete(int id)
        {
            StepQueue stepqueue = db.StepQueues.Find(id);

            db.StepQueues.Remove(stepqueue);
            db.SaveChanges();
            return(RedirectToAction("Index", new { id = stepqueue.StepFileId }));
        }
Пример #2
0
 public ActionResult Create([Bind(Include = "QueueId,StepId,StepFileId,StepName,StepValue,State")] StepQueue stepqueue)
 {
     if (ModelState.IsValid)
     {
         db.StepQueues.Add(stepqueue);
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = stepqueue.StepFileId }));
     }
     return(View(stepqueue));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "QueueId,StepId,StepFileId,StepName,StepValue,State")] StepQueue stepqueue)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stepqueue).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = stepqueue.StepFileId }));
     }
     return(View(stepqueue));
 }
Пример #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StepQueue stepqueue = db.StepQueues.Find(id);

            if (stepqueue == null)
            {
                return(HttpNotFound());
            }
            return(View(stepqueue));
        }
Пример #5
0
 public JsonResult Add(StepQueue stepqueue)
 {
     return(Json(db.StepQueues.Add(stepqueue), JsonRequestBehavior.AllowGet));
 }
Пример #6
0
        void Compile(Group root, DateTime Version, XElement config)
        {
            int cpus = Cpus;

            //var parallel = config.Attribute("Parallel");
            //if (parallel != null && string.Equals(parallel.Value ?? "", "false", StringComparison.OrdinalIgnoreCase)) cpus = 1;

            if (RebuildAll)
            {
                Version = DateTime.Now.ToUniversalTime();
            }
            try {
                var scenes = ParseScenes(root, Version, config).ToList();

                var building = CheckNeedsBuilding(scenes);

                NeedsBuilding = NeedsBuilding || building;

                // compile dependencies
                foreach (var scene in scenes)
                {
                    foreach (var dependency in scene.DependsOn)
                    {
                        var c = new Compiler();
                        this.CopyTo(c);
                        c.SourceFiles = new List <string>()
                        {
                            dependency
                        };
                        c.SeparateAppDomain = false;
                        c.Compile();
                    }
                }

                if (!building || CheckBuilding)
                {
                    if (!CheckBuilding)
                    {
                        root.Errors.Clear();
                    }
                    return;
                }

                LoadDlls();

                var steps = new StepQueue(root, Version, config, this, scenes, CheckBuilding);

                for (int cpu = cpus - 1; cpu >= 0; cpu--)
                {
                    var cpul = cpu;
                    ParameterizedThreadStart task = (state) => {                     // iterate over all steps
                        try {
                            steps.Init(cpul);
                            try {
                                var step = steps.Next(cpul);
                                while (step != null)
                                {
                                    try {
                                        step.Process();
                                        step = steps.Next(cpul);
                                    } catch (CompilerException cex) {
                                        //root.Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject);
                                        HandleException(cex, root.Errors);
                                    } catch (Exception ex) {
                                        root.Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", null);
                                    }
                                }
                            } catch (CompilerException cex) {
                                //root.Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject);
                                HandleException(cex, root.Errors);
                            } catch (Exception ex) {
                                root.Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", null);
                            } finally {
                                steps.Stop(cpul);
                            }
                        } catch (CompilerException cex) {
                            //root.Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject);
                            HandleException(cex, root.Errors);
                        } catch (Exception ex) {
                            root.Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", null);
                        } finally {
                        }
                    };

                    if (cpul > 0)
                    {
                        var thread = new Thread(new ParameterizedThreadStart(task));
                        thread.SetApartmentState(ApartmentState.STA);
                        if (Culture != null)
                        {
                            thread.CurrentCulture = thread.CurrentUICulture = Culture;
                        }
                        thread.Start();
                        Threads.Add(thread);
                    }
                    else
                    {
                        task(null);
                    }
                }
            } catch (CompilerException cex) {
                //root.Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject);
                HandleException(cex, root.Errors);
            } catch (Exception ex) {
                root.Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", null);
            } finally {
            }
        }