Example #1
0
 /// <summary>
 /// 保存游戏配置。
 /// </summary>
 /// <returns>是否保存游戏配置成功。</returns>
 public override bool Save()
 {
     using (FileStream fileStream = new FileStream(FilePath, FileMode.Create, FileAccess.Write))
     {
         return(m_Serializer.Serialize(fileStream, m_Settings));
     }
 }
Example #2
0
 /// <summary>
 /// 保存游戏配置。
 /// </summary>
 /// <returns>是否保存游戏配置成功。</returns>
 public override bool Save()
 {
     try
     {
         using (FileStream fileStream = new FileStream(FilePath, FileMode.Create, FileAccess.Write))
         {
             return(m_Serializer.Serialize(fileStream, m_Settings));
         }
     }
     catch (Exception exception)
     {
         Log.Warning("Save settings failure with exception '{0}'.", exception.ToString());
         return(false);
     }
 }