Exemplo n.º 1
0
        /// <summary>
        /// Opens the file using the specified options.
        /// </summary>
        /// <param name="fileMode">The file mode.</param>
        /// <param name="fileAccess">The file access.</param>
        /// <param name="fileShare">The file share.</param>
        /// <returns>A <see cref="Stream" /> to the file.</returns>
        public Stream Open(FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
        {
            bool fileWasCreated;
            var  position = GetPosition(fileMode, out fileWasCreated);

            if (fileWasCreated)
            {
                _tree.CreateFile(this);
            }
            return(new FakeFileStream(this)
            {
                Position = position
            });
        }
 public Stream Open(FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
 {
     return(_file.Open((System.IO.FileMode)fileMode,
                       (System.IO.FileAccess)fileAccess,
                       (System.IO.FileShare)fileShare));
 }