Exemple #1
0
        public async Task CopyFileAsync(string source, string destination, bool overwrite, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

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

            return(IsFileExists(filename));
        }
Exemple #3
0
        public async Task DeleteFileAsync(string filename, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

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

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

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

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

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

            DeleteDirectory(directory, recursive);
        }
Exemple #9
0
        public async Task CreateDirectoryAsync(string directory, CancellationToken token)
        {
            await AwaitExtensions.SwitchOffMainThreadAsync(token);

            CreateDirectory(directory);
        }