This class reimplements OEIShared.IO.ERFResourceRepository, however in a fashion that is compatible with the content patcher (files are not kept locked without share delete). It only supports read only access to the ERF.
Наследование: OEIShared.IO.ResourceRepository, IDisposable
Пример #1
0
        /// <summary>
        /// Release reference to the repository.
        /// </summary>
        public override void Release()
        {
            ALFAERFResourceRepository Container = Repository as ALFAERFResourceRepository;

            ReleaseRef();

            if (Container == null)
            {
                throw new OEIShared.IO.OEIIOException(OEIShared.IO.OEIIOExceptionCause.BadRepositoryState);
            }

            Container.ErfFile[EncapsulatedFileName].FlushData();
        }
Пример #2
0
        /// <summary>
        /// Get a resource stream for the resource.
        /// </summary>
        /// <param name="Write">Supplies true if write access is requested,
        /// else false if only read only access is requested.</param>
        /// <returns>The I/O stream object.</returns>
        public override Stream GetStream(bool Write)
        {
            if (Write == true)
            {
                throw new OEIShared.IO.OEIIOException(OEIShared.IO.OEIIOExceptionCause.BadParameter);
            }

            ALFAERFResourceRepository Container = Repository as ALFAERFResourceRepository;

            if (Container == null)
            {
                throw new OEIShared.IO.OEIIOException(OEIShared.IO.OEIIOExceptionCause.BadRepositoryState);
            }

            GetRef();

            return(new MemoryStream(Container.ErfFile[EncapsulatedFileName].Data));
        }