/// <summary> /// Eminence.xmlの内容を全て取得する /// </summary> /// <returns>GearDBModel</returns> private EminenceDBModel getEminenceDB() { try { string xmlFilename = PATH_FISHDB + @"\" + FILENAME_EMINENCEDB; EminenceDBModel eminenceDB = new EminenceDBModel(); if (File.Exists(xmlFilename)) { FileStream fs = new FileStream(xmlFilename, System.IO.FileMode.Open); XmlSerializer serializer = new XmlSerializer(typeof(EminenceDBModel)); eminenceDB = (EminenceDBModel)serializer.Deserialize(fs); fs.Close(); } return(eminenceDB); } catch (Exception e) { logger.Fatal("{0}の取得中にエラーが発生しました。", FILENAME_EMINENCEDB); throw e; } }
/// <summary> /// エミネンスを取得する /// </summary> /// <param name="iSearchString">エミネンス名</param> /// <returns>装備の一覧</returns> public List <EminenceDBEminenceModel> SelectEminence(string iSearchString) { logger.Trace("SearchString={0}", iSearchString); List <EminenceDBEminenceModel> ret = new List <EminenceDBEminenceModel>(); EminenceDBModel eminenceDB = getEminenceDB(); if (iSearchString == string.Empty) { ret = eminenceDB.Eminences; } else { foreach (EminenceDBEminenceModel eminences in eminenceDB.Eminences) { if (MiscTool.IsRegexString(eminences.EminenceName, iSearchString)) { ret.Add(eminences); } } } return(ret); }