示例#1
0
        // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------

        /// <summary>
        /// Saves the contents in the given <paramref name="stream"/> and optionally leaves it open
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> to save the contents into.</param>
        /// <param name="leaveOpen"><c>true</c> to leave the stream open after writing, otherwise <c>false</c>.</param>
        public void Save(Stream stream, bool leaveOpen = false)
        {
            if (IsPlatformSwitch)
            {
                using (ResFileSaver saver = new Switch.Core.ResFileSwitchSaver(this, stream, leaveOpen)) {
                    saver.Execute();
                }
            }
            else
            {
                using (ResFileSaver saver = new WiiU.Core.ResFileWiiUSaver(this, stream, leaveOpen)) {
                    saver.Execute();
                }
            }
        }
示例#2
0
 /// <summary>
 /// Saves the contents in the file with the given <paramref name="fileName"/>.
 /// </summary>
 /// <param name="fileName">The name of the file to save the contents into.</param>
 public void Save(string fileName)
 {
     if (IsPlatformSwitch)
     {
         using (ResFileSaver saver = new Switch.Core.ResFileSwitchSaver(this, fileName)) {
             saver.Execute();
         }
     }
     else
     {
         using (ResFileSaver saver = new WiiU.Core.ResFileWiiUSaver(this, fileName)) {
             saver.Execute();
         }
     }
 }
示例#3
0
 static internal void ExportSection(string fileName, IResData resData, ResFile resFile)
 {
     if (resFile.IsPlatformSwitch)
     {
         using (var saver = new Switch.Core.ResFileSwitchSaver(resData, resFile, fileName)) {
             saver.ExportSection();
         }
     }
     else
     {
         using (var saver = new WiiU.Core.ResFileWiiUSaver(resData, resFile, fileName)) {
             saver.ExportSection();
         }
     }
 }