Exemplo n.º 1
0
 public EmbeddedStorage(string path)
 {
     _compoundFile = new CompoundFile(path, new CompoundFile.CompoundFileOptions{ FlushAtWrite = true, UseWriteCache = false });
     _toc = new Toc();
     if (!InitializeToc())
     {
         if (!AllocateToc())
         {
             throw new Exception("Catastrophic failure. Could not allocate TOC.");
         }
     }
 }
Exemplo n.º 2
0
 private void Dispose(bool disposing)
 {
     if (!disposing) return;
     if (_disposed) return;
     _disposed = true;
     if (_compoundFile != null)
     {
         lock (_sync)
         {
             _compoundFile.Dispose();
             _compoundFile = null;
         }                
     }
 }