Microsoft.Cci.MetadataReaderHost.OpenBinaryDocument C# (CSharp) Méthode

OpenBinaryDocument() public méthode

Open the binary document as a memory block in host dependent fashion. IMPORTANT: The lifetime of the memory block is the same as the lifetime of this host object. Be sure to call Dispose on the host object when it is no longer needed, otherwise files may stay locked, or resources such as large blocks of memory may remain allocated until the host's finalizer method runs.
When overridding this method, be sure to add any disposable objects to this.disposableObjectAllocatedByThisHost.
public OpenBinaryDocument ( IBinaryDocument sourceDocument ) : IBinaryDocumentMemoryBlock
sourceDocument IBinaryDocument The binary document that is to be opened.
Résultat IBinaryDocumentMemoryBlock
    public virtual IBinaryDocumentMemoryBlock/*?*/ OpenBinaryDocument(IBinaryDocument sourceDocument) {
      try {
#if !COMPACTFX && !__MonoCS__
        IBinaryDocumentMemoryBlock binDocMemoryBlock = MemoryMappedFile.CreateMemoryMappedFile(sourceDocument.Location, sourceDocument);
#else
        IBinaryDocumentMemoryBlock binDocMemoryBlock = UnmanagedBinaryMemoryBlock.CreateUnmanagedBinaryMemoryBlock(sourceDocument.Location, sourceDocument);
#endif
        this.disposableObjectAllocatedByThisHost.Add((IDisposable)binDocMemoryBlock);
        return binDocMemoryBlock;
      } catch (IOException) {
        return null;
      }
    }

Same methods

MetadataReaderHost::OpenBinaryDocument ( IBinaryDocument parentSourceDocument, string childDocumentName ) : IBinaryDocumentMemoryBlock