private async void VirtualFileSystemConfigurationDialog_Load(object sender, EventArgs e) { string filePath = @"C:\testDirectory\test.txt"; string directoryPath = @"c:\testDirectory"; var roots = await _virtualFileSystem.GetRootsAsync(); if (checkIfExist(directoryPath, filePath) == false && roots != null) { await _virtualFileSystem.CreateDirectoryAsync(directoryPath); using (StreamWriter sw = File.CreateText(filePath)) { sw.WriteLine("Done! "); } var getDirectories = await _virtualFileSystem.GetDirectoriesAsync(roots[0]); var searchDriectories = getDirectories.FirstOrDefault(x => x.Name == "testDirectory"); if (searchDriectories != null) { var getFiles = await _virtualFileSystem.GetFilesAsync(searchDriectories, "*.txt"); fillFilesGrid(getFiles); } fillDirectoriesGrid(getDirectories); } fillGetRootsGrid(roots, directoryPath, filePath); }
public async Task DisplayStatusAsync(object statusInformation) { string filePath = @"C:\testDirectory\test.txt"; string directoryPath = @"c:\testDirectory"; var roots = await _virtualFileSystem.GetRootsAsync(); if (checkIfExist(directoryPath, filePath) == false && roots != null) { await _virtualFileSystem.CreateDirectoryAsync(directoryPath); using (StreamWriter sw = File.CreateText(filePath)) { sw.WriteLine("Done! "); } var getDirectories = await _virtualFileSystem.GetDirectoriesAsync(roots[0]); var searchDriectories = getDirectories.FirstOrDefault(x => x.Name == "testDirectory"); if (searchDriectories != null) { var getFiles = await _virtualFileSystem.GetFilesAsync(searchDriectories, "*.txt"); fillFilesGrid(getFiles); } fillDirectoriesGrid(getDirectories); } fillGetRootsGrid(roots, directoryPath, filePath); }