コード例 #1
0
        ///// ------------------------------------------------------------------------------------
        ///// <summary>
        ///// Asks the user to specify a TMX file for saving TMX information.
        ///// </summary>
        ///// ------------------------------------------------------------------------------------
        //public static string AskForTMXFileAndWrite(TMXDocument tmxDoc)
        //{
        //    using (SaveFileDialog dlg = new SaveFileDialog())
        //    {
        //        dlg.OverwritePrompt = true;
        //        dlg.Title = Properties.Resources.kstidTMXSFDCaption;
        //        dlg.Filter = Properties.Resources.kstidTMXOpenAndSaveDlgFilter;
        //        DialogResult result = dlg.ShowDialog();
        //        if (result == DialogResult.Cancel)
        //            return null;

        //        Write(tmxDoc, dlg.FileName);
        //        return dlg.FileName;
        //    }
        //}

        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Writes the specified TMXDocument information to the specified TMX file.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static void Write(TMXDocument tmxDoc, string tmxFile)
        {
            if (tmxDoc == null)
            {
                throw new ArgumentNullException("tmxDoc");
            }

            XmlSerializationHelper.SerializeToFile(tmxFile, tmxDoc);
        }
コード例 #2
0
ファイル: TMXDocument.cs プロジェクト: vkarthim/l10nsharp
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Saves the TMXDocument to the specified TMX file.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public void Save(string tmxFile)
 {
     XmlSerializationHelper.SerializeToFile(tmxFile, this);
 }