public static List <CMnuItem> GetMnuItems(string pFileName) { XmlTextReader xmlTextReader = new XmlTextReader(pFileName); List <CMnuItem> result = CMnuDef.XML2Items(xmlTextReader); xmlTextReader.Close(); return(result); }
public void LoadScripts(string pFileName) { try { this.mnuItems = CMnuDef.GetMnuItems(pFileName); this.scripts = new List <CScript>(); foreach (CMnuItem current in this.mnuItems) { foreach (CScriptDef current2 in current.ScriptDefs) { if (current2.scrptfile.Length > 0) { bool flag = false; int count = this.scripts.Count; for (int i = 0; i < count; i++) { if (current2.scrptfile == this.scripts[i].ScrptFile) { flag = true; break; } } if (!flag) { CScript cScript = new CScript(this.myThucHanh, current2.scrptfile); cScript.StopTickCount = cScript.LoadActions(); this.scripts.Add(cScript); } } } } } catch (Exception ex) { throw ex; } }