Esempio n. 1
0
        internal static new 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;
        }
Esempio n. 2
0
        new internal static IFileSystemInformation Create(string originalPath, SafeFileHandle fileHandle, NativeMethods.FileManagement.BY_HANDLE_FILE_INFORMATION info, IFileService fileService)
        {
            if ((info.dwFileAttributes & System.IO.FileAttributes.Directory) != 0) throw new ArgumentOutOfRangeException(nameof(info));

            var fileInfo = new FileInformation(fileService);
            fileInfo.PopulateData(originalPath, fileHandle, info);
            return fileInfo;
        }