Пример #1
0
        public async Task CopyFileAsync(string source, string destination, bool overwrite, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            CopyFile(source, destination, overwrite);
        }
Пример #2
0
        public async Task <bool> IsFileExistsAsync(string filename, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            return(IsFileExists(filename));
        }
Пример #3
0
        public async Task DeleteFileAsync(string filename, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            DeleteFile(filename);
        }
Пример #4
0
        public async Task MoveFileAsync(string source, string destination, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            MoveFile(source, destination);
        }
Пример #5
0
        public async Task <Stream> OpenReadAsync(string filename, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            return(OpenRead(filename));
        }
Пример #6
0
        public async Task <string[]> GetFilesAsync(string directory, string pattern, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            return(GetFiles(directory, pattern));
        }
Пример #7
0
        public async Task <bool> IsDirectoryExistsAsync(string directory, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            return(IsDirectoryExists(directory));
        }
Пример #8
0
        public async Task DeleteDirectoryAsync(string directory, bool recursive, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            DeleteDirectory(directory, recursive);
        }
Пример #9
0
        public async Task CreateDirectoryAsync(string directory, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            CreateDirectory(directory);
        }