Exemplo n.º 1
0
 /// <summary>
 /// Bait.xmlに登録内容を書き出す
 /// </summary>
 /// <param name="iBaitDB">BaitDBModel</param>
 /// <returns>True:成功</returns>
 private bool putBaitDB(BaitDBModel iBaitDB)
 {
     string xmlFilename = PATH_FISHDB + @"\" + FILENAME_BAITDB;
     StreamWriter sw = new StreamWriter(xmlFilename, false, new UTF8Encoding(false));
     XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
     ns.Add(String.Empty, String.Empty);
     XmlSerializer serializer = new XmlSerializer(typeof(BaitDBModel));
     serializer.Serialize(sw, iBaitDB, ns);
     //書き込み
     sw.Flush();
     sw.Close();
     sw = null;
     return true;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Bait.xmlの内容を全て取得する
 /// </summary>
 /// <returns>BaitDBModel</returns>
 private BaitDBModel getBaitDB()
 {
     string xmlFilename = PATH_FISHDB + @"\" + FILENAME_BAITDB;
     BaitDBModel Baitdb = new BaitDBModel();
     if (File.Exists(xmlFilename))
     {
         FileStream fs = new FileStream(xmlFilename, System.IO.FileMode.Open);
         XmlSerializer serializer = new XmlSerializer(typeof(BaitDBModel));
         Baitdb = (BaitDBModel)serializer.Deserialize(fs);
         fs.Close();
     }
     return Baitdb;
 }