aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-16 14:32:39 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-16 14:32:39 +0200
commitadabe4e1b99bc57f0381fb0a5bb3192ac0fdff18 (patch)
treeadfce075209485fb449af343b1b7877d02b93e64 /Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem
parentb188d7bfd91062f65474bd139bb8a434694f117b (diff)
downloadTango-adabe4e1b99bc57f0381fb0a5bb3192ac0fdff18.tar.gz
Tango-adabe4e1b99bc57f0381fb0a5bb3192ac0fdff18.zip
Working on FSE/PPC FileSystem Provider/Service.
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs72
1 files changed, 72 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs
new file mode 100644
index 000000000..48da65f16
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs
@@ -0,0 +1,72 @@
+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<IFileSystemContainer> GetFolder(string path)
+ {
+ var response = await _machineProvider.MachineOperator.SendGenericRequest<GetFileSystemItemRequest, GetFileSystemItemResponse>(new GetFileSystemItemRequest()
+ {
+ Path = path
+ }, new TransportRequestConfig()
+ {
+ Timeout = TimeSpan.FromSeconds(30),
+ });
+
+ return FileSystemItem.FromDTO(response.FileSystemItem) as IFileSystemContainer;
+ }
+
+ public async Task<IFileSystemContainer> GetSpecialFolder(Environment.SpecialFolder specialFolder)
+ {
+ var response = await _machineProvider.MachineOperator.SendGenericRequest<GetFileSystemItemRequest, GetFileSystemItemResponse>(new GetFileSystemItemRequest()
+ {
+ SpecialFolder = specialFolder
+ }, new TransportRequestConfig()
+ {
+ Timeout = TimeSpan.FromSeconds(30),
+ });
+
+ return FileSystemItem.FromDTO(response.FileSystemItem) as IFileSystemContainer;
+ }
+
+ public async Task<IFileSystemContainer> GetThisPC()
+ {
+ var response = await _machineProvider.MachineOperator.SendGenericRequest<GetFileSystemItemRequest, GetFileSystemItemResponse>(new GetFileSystemItemRequest()
+ {
+ //No parameters at all
+ }, new TransportRequestConfig()
+ {
+ Timeout = TimeSpan.FromSeconds(30),
+ });
+
+ return FileSystemItem.FromDTO(response.FileSystemItem) as IFileSystemContainer;
+ }
+
+ public Task<FileSystemHandler> Download(FileSystemItem item, string targetFolderPath)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task<FileSystemHandler> Upload(string sourcePath, string targetPath)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}