Exemplo n.º 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;
			}
		}
Exemplo n.º 2
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;
     }
 }
        public IFile GetFile(string fileName)
        {
            InMemoryFile file;

            lock (ChildFiles)
            {
                file = ChildFiles.FirstOrDefault(x => x.Name.Equals(fileName, _stringComparison));
                if (file == null)
                {
                    file = new InMemoryFile(Path.Combine(fileName).FullPath)
                    {
                        Parent = this
                    };
                    ChildFiles.Add(file);
                }
                file.FileSystem = FileSystem;
            }
            return(file);
        }
Exemplo n.º 4
0
			public InMemFileStream(InMemoryFile file, FileAccess fileAccess)
			{
				_file = file;
				_fileAccess = fileAccess;
			}
Exemplo n.º 5
0
 public InMemFileStream(InMemoryFile file, FileAccess fileAccess)
 {
     _file       = file;
     _fileAccess = fileAccess;
 }