public bool LoadMobList() { ReportUpdate("Mobs"); if (File.Exists(MoblistFilepath) == false) { return(false); } XmlSerializer xml = new XmlSerializer(typeof(MobDBMobList)); try { using (FileStream fs = new FileStream(MoblistFilepath, FileMode.Open)) { MobDBMobList mobs = (MobDBMobList)xml.Deserialize(fs); if (mobs != null && mobs.Count > 0) { AddRange(mobs.ToArray()); } } } catch { return(false); } if (Count == 0) { return(false); } return(true); }
public bool LoadMobList() { if (File.Exists(MoblistFilepath) == false) { return(false); } XmlSerializer xml = new XmlSerializer(typeof(MobDBMobList)); try { using (FileStream fs = new FileStream(MoblistFilepath, FileMode.Open)) { mMobs = (MobDBMobList)xml.Deserialize(fs); } } catch { return(false); } if (mMobs == null || mMobs.Count == 0) { return(false); } return(true); }
public MobDB2XML() { mMobs = new MobDBMobList(); }