示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResFile"/> class from the file with the given
 /// <paramref name="fileName"/>.
 /// </summary>
 /// <param name="fileName">The name of the file to load the data from.</param>
 public ResFile(string fileName)
 {
     if (IsSwitchBinary(fileName))
     {
         using (ResFileLoader loader = new Switch.Core.ResFileSwitchLoader(this, fileName)) {
             loader.Execute();
         }
     }
     else
     {
         using (ResFileLoader loader = new WiiU.Core.ResFileWiiULoader(this, fileName)) {
             loader.Execute();
         }
     }
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResFile"/> class from the given <paramref name="stream"/> which
 /// is optionally left open.
 /// </summary>
 /// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
 /// <param name="leaveOpen"><c>true</c> to leave the stream open after reading, otherwise <c>false</c>.</param>
 public ResFile(Stream stream, bool leaveOpen = false)
 {
     if (IsSwitchBinary(stream))
     {
         using (ResFileLoader loader = new Switch.Core.ResFileSwitchLoader(this, stream)) {
             loader.Execute();
         }
     }
     else
     {
         using (ResFileLoader loader = new WiiU.Core.ResFileWiiULoader(this, stream)) {
             loader.Execute();
         }
     }
 }