Beispiel #1
0
 internal static IFileSystemInformation Create(NativeMethods.FileManagement.FindResult findResult, IFileService fileService)
 {
     if ((findResult.Attributes & System.IO.FileAttributes.Directory) != 0)
     {
         return(DirectoryInformation.Create(findResult, fileService));
     }
     else
     {
         return(FileInformation.Create(findResult, fileService));
     }
 }
Beispiel #2
0
 protected virtual void PopulateData(NativeMethods.FileManagement.FindResult findResult)
 {
     this.source         = Source.FindResult;
     this.Path           = Paths.Combine(findResult.BasePath, findResult.FileName);
     this.Attributes     = findResult.Attributes;
     this.CreationTime   = findResult.Creation;
     this.LastAccessTime = findResult.LastAccess;
     this.LastWriteTime  = findResult.LastWrite;
     this.Name           = findResult.FileName;
     this.Exists         = true;
 }
Beispiel #3
0
        new static internal IFileSystemInformation Create(NativeMethods.FileManagement.FindResult findResult, IFileService fileService)
        {
            if ((findResult.Attributes & System.IO.FileAttributes.Directory) != 0)
            {
                throw new ArgumentOutOfRangeException(nameof(findResult));
            }

            var fileInfo = new FileInformation(fileService);

            fileInfo.PopulateData(findResult);
            return(fileInfo);
        }
Beispiel #4
0
 protected override void PopulateData(NativeMethods.FileManagement.FindResult findResult)
 {
     base.PopulateData(findResult);
     this.Length    = findResult.Length;
     this.directory = findResult.BasePath;
 }
Beispiel #5
0
 protected override void PopulateData(NativeMethods.FileManagement.FindResult findResult)
 {
     base.PopulateData(findResult);
 }