コード例 #1
0
        public static List <CMnuItem> GetMnuItems(string pFileName)
        {
            XmlTextReader   xmlTextReader = new XmlTextReader(pFileName);
            List <CMnuItem> result        = CMnuDef.XML2Items(xmlTextReader);

            xmlTextReader.Close();
            return(result);
        }
コード例 #2
0
 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;
     }
 }