/// <summary> /// Creates an application context instruction. /// </summary> /// <param name="xn">The XML repersentation of the instruction to be checked</param> /// <param name="con">The current context object</param> static ApplicationContext CreateApplicationContext(XmlNode xn, Context con) { ApplicationContext ac = new ApplicationContext(); ac.Run = XmlFiler.getAttribute(xn, "run"); if (ac.Run == null || ac.Run == "") { ac.Run = "ok"; } ac.Gui = XmlFiler.getAttribute(xn, "gui"); ac.Path = XmlFiler.getAttribute(xn, "path"); ac.Exe = XmlFiler.getAttribute(xn, "exe"); ac.Args = XmlFiler.getAttribute(xn, "args"); ac.Work = XmlFiler.getAttribute(xn, "work"); ac.Title = XmlFiler.getAttribute(xn, "title"); string src = XmlFiler.getAttribute(xn, "source"); if (src != null) { ac.SetSource(src); } ac.Close = XmlFiler.getAttribute(xn, "close"); ac.OnPass = XmlFiler.getAttribute(xn, "on-pass"); ac.OnFail = XmlFiler.getAttribute(xn, "on-fail"); string rest = XmlFiler.getAttribute(xn, "wait"); if (rest != null) { ac.Rest = Convert.ToInt32(rest); } ac.Configure(); // set model root for use by children ac.ModelNode = con.ModelNode; AddInstruction(xn, ac, con); return(ac); }
/// <summary> /// Creates an application context instruction. /// </summary> /// <param name="xn">The XML repersentation of the instruction to be checked</param> /// <param name="con">The current context object</param> static ApplicationContext CreateApplicationContext(XmlNode xn, Context con) { ApplicationContext ac = new ApplicationContext(); ac.Run = XmlFiler.getAttribute(xn, "run"); if (ac.Run == null || ac.Run == "") ac.Run = "ok"; ac.Gui = XmlFiler.getAttribute(xn, "gui"); ac.Path = XmlFiler.getAttribute(xn, "path"); ac.Exe = XmlFiler.getAttribute(xn, "exe"); ac.Args = XmlFiler.getAttribute(xn, "args"); ac.Work = XmlFiler.getAttribute(xn, "work"); ac.Title = XmlFiler.getAttribute(xn, "title"); string src = XmlFiler.getAttribute(xn, "source"); if (src != null) ac.SetSource(src); ac.Close = XmlFiler.getAttribute(xn, "close"); ac.OnPass = XmlFiler.getAttribute(xn, "on-pass"); ac.OnFail = XmlFiler.getAttribute(xn, "on-fail"); string rest = XmlFiler.getAttribute(xn, "wait"); if (rest != null) ac.Rest = Convert.ToInt32(rest); ac.Configure(); // set model root for use by children ac.ModelNode = con.ModelNode; AddInstruction(xn, ac, con); return ac; }