using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.FileSystem; using Tango.FileSystem.Network; using Tango.FSE.Common.Connection; using Tango.FSE.Common.FileSystem; using Tango.Transport; namespace Tango.FSE.UI.FileSystem { public class DefaultFileSystemProvider : IFileSystemProvider { private IMachineProvider _machineProvider; public DefaultFileSystemProvider(IMachineProvider machineProvider) { _machineProvider = machineProvider; } public async Task GetFolder(string path) { var response = await _machineProvider.MachineOperator.SendGenericRequest(new GetFileSystemItemRequest() { Path = path }, new TransportRequestConfig() { Timeout = TimeSpan.FromSeconds(30), }); return FileSystemItem.FromDTO(response.FileSystemItem) as IFileSystemContainer; } public async Task GetSpecialFolder(Environment.SpecialFolder specialFolder) { var response = await _machineProvider.MachineOperator.SendGenericRequest(new GetFileSystemItemRequest() { SpecialFolder = specialFolder }, new TransportRequestConfig() { Timeout = TimeSpan.FromSeconds(30), }); return FileSystemItem.FromDTO(response.FileSystemItem) as IFileSystemContainer; } public async Task GetThisPC() { var response = await _machineProvider.MachineOperator.SendGenericRequest(new GetFileSystemItemRequest() { //No parameters at all }, new TransportRequestConfig() { Timeout = TimeSpan.FromSeconds(30), }); return FileSystemItem.FromDTO(response.FileSystemItem) as IFileSystemContainer; } public Task Download(FileSystemItem item, string targetFolderPath) { throw new NotImplementedException(); } public Task Upload(string sourcePath, string targetPath) { throw new NotImplementedException(); } } }