상속: System.IO.File
예제 #1
0
 private void CopyFromFile(InMemoryFile fileToCopy)
 {
     _exists = true;
     _LastModifiedTimeUtc = fileToCopy.GetLastModifiedTimeUtc();
     lock (fileToCopy._contentLock)
     {
         var newContent = new byte[fileToCopy._content.Length];
         Buffer.BlockCopy(fileToCopy._content, 0, newContent, 0, fileToCopy._content.Length);
         _content       = newContent;
         _contentLength = fileToCopy._contentLength;
     }
 }
예제 #2
0
        public File GetFile(string fileName)
        {
            InMemoryFile file;

            lock (ChildFiles)
            {
                file = ChildFiles.FirstOrDefault(x => x.Name.Equals(fileName, StringComparison.OrdinalIgnoreCase));
                if (file == null)
                {
                    file = new InMemoryFile(Path.Combine(fileName).FullPath)
                    {
                        Parent = this
                    };
                    ChildFiles.Add(file);
                }
                file.FileSystem = FileSystem;
            }
            return(file);
        }
예제 #3
0
 public InMemFileStream(InMemoryFile file, FileAccess fileAccess)
 {
     _file       = file;
     _fileAccess = fileAccess;
 }
예제 #4
0
 public InMemFileStream(InMemoryFile file, FileAccess fileAccess)
 {
     _file = file;
     _fileAccess = fileAccess;
 }
예제 #5
0
 private void CopyFromFile(InMemoryFile fileToCopy)
 {
     _exists = true;
     _LastModifiedTimeUtc = fileToCopy.GetLastModifiedTimeUtc();
     lock (fileToCopy._contentLock)
     {
         var newContent = new byte[fileToCopy._content.Length];
         Buffer.BlockCopy(fileToCopy._content, 0, newContent, 0, fileToCopy._content.Length);
         _content = newContent;
         _contentLength = fileToCopy._contentLength;
     }
 }