Пример #1
0
 /// <summary>
 ///     Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     _pointerWrapper?.Dispose();
     _pointerWrapper = null;
     _nodes          = null;
     _strings        = null;
     GC.SuppressFinalize(this);
 }
Пример #2
0
 /// <summary>Creates and loads a WZ file from a path. The Stream created will be disposed when the WZ file is disposed.</summary>
 /// <param name="path"> The path where the WZ file is located. </param>
 /// <param name="variant"> The variant of this WZ file. </param>
 /// <param name="encrypted"> Whether the WZ file is encrypted outside a WZ image. </param>
 /// <param name="flag"> WZ parsing flags. </param>
 public unsafe WZFile(string path, WZVariant variant, bool encrypted, WZReadSelection flag = WZReadSelection.None)
 {
     _variant   = variant;
     _encrypted = encrypted;
     _flag      = flag;
     _aes       = new WZAES(_variant);
     _bpo       = new MemoryMappedFile(path);
     _r         = new WZBinaryReader(_bpo.Pointer, _bpo.Length, _aes, 0);
     Parse();
 }
Пример #3
0
 /// <summary>
 ///     Creates and loads a NX file from a byte pointer object.
 /// </summary>
 /// <param name="input"> The byte pointer object containing the NX file. </param>
 /// <param name="flag"> NX parsing flags. </param>
 public NXFile(IBytePointerObject input, NXReadSelection flag = NXReadSelection.None)
 {
     Flags  = flag;
     _start = (_pointerWrapper = input).Pointer;
     Parse();
 }