aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.FileSystem
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-04-21 14:21:19 +0300
committerAvi Levkovich <avi@twine-s.com>2020-04-21 14:21:19 +0300
commitcd728bf3a7d1db76747cb18bcfe396c83d690e86 (patch)
tree99347262eef3f175a7ff1441b6c5a031be74d26f /Software/Visual_Studio/Tango.FileSystem
parent7fe23e68512e2462de107e76ae3a92ddd381ac77 (diff)
parent97a784b6ce43960bdb92465b08f26d3562a4f202 (diff)
downloadTango-cd728bf3a7d1db76747cb18bcfe396c83d690e86.tar.gz
Tango-cd728bf3a7d1db76747cb18bcfe396c83d690e86.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.FileSystem')
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs10
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs24
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs2
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/Network/FileSystemItemDTO.cs2
4 files changed, 37 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
index 0a7fe8ddc..58d0772f5 100644
--- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
+++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
@@ -305,6 +305,14 @@ namespace Tango.FileSystem
public static readonly DependencyProperty SelectionModeProperty =
DependencyProperty.Register("SelectionMode", typeof(SelectionMode), typeof(FileExplorerControl), new PropertyMetadata(SelectionMode.Extended));
+ public bool AllowFolderDownload
+ {
+ get { return (bool)GetValue(AllowFolderDownloadProperty); }
+ set { SetValue(AllowFolderDownloadProperty, value); }
+ }
+ public static readonly DependencyProperty AllowFolderDownloadProperty =
+ DependencyProperty.Register("AllowFolderDownload", typeof(bool), typeof(FileExplorerControl), new PropertyMetadata(true));
+
static FileExplorerControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(FileExplorerControl), new FrameworkPropertyMetadata(typeof(FileExplorerControl)));
@@ -369,7 +377,7 @@ namespace Tango.FileSystem
DownloadCommand?.Execute(SelectedItems.ToList());
- }, () => SelectedItems != null && SelectedItems.Count > 0 && SelectedItems.All(x => x.Type != FileSystemItemType.Drive));
+ }, () => SelectedItems != null && SelectedItems.Count > 0 && SelectedItems.All(x => x.Type != FileSystemItemType.Drive && (AllowFolderDownload || x.Type == FileSystemItemType.File)));
OpenCommand = new RelayCommand(() =>
{
diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs
index c8b2fce32..c78a11732 100644
--- a/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs
+++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs
@@ -25,6 +25,8 @@ namespace Tango.FileSystem
public DateTime DateModified { get; set; }
+ public DateTime DateCreated { get; set; }
+
public long Size { get; set; }
public String Name
@@ -75,11 +77,33 @@ namespace Tango.FileSystem
}
item.DateModified = dto.DateModified;
+ item.DateCreated = dto.DateCreated;
item.Path = dto.Path;
item.Size = dto.Size;
item.Type = dto.Type;
return item;
}
+
+ public String GetParent()
+ {
+ if (Path == "/") return null;
+
+ String root = System.IO.Path.GetPathRoot(Path);
+ var parent = Directory.GetParent(Path);
+
+ if (root == "\\")
+ {
+ return parent.FullName.Replace(parent.Root.FullName, "/").Replace("\\", "/");
+ }
+ else if (parent != null)
+ {
+ return parent.FullName;
+ }
+ else
+ {
+ return null;
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
index c08304ca8..dc8efa7dd 100644
--- a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
+++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
@@ -71,6 +71,7 @@ namespace Tango.FileSystem
Path = directory,
Type = FileSystemItemType.Folder,
DateModified = Directory.GetLastWriteTimeUtc(directory),
+ DateCreated = Directory.GetCreationTimeUtc(directory),
});
}
@@ -83,6 +84,7 @@ namespace Tango.FileSystem
Path = file,
Type = FileSystemItemType.File,
DateModified = File.GetLastWriteTimeUtc(file),
+ DateCreated = File.GetCreationTimeUtc(file),
Size = new FileInfo(file).Length
});
}
diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/FileSystemItemDTO.cs b/Software/Visual_Studio/Tango.FileSystem/Network/FileSystemItemDTO.cs
index 900ba0628..43467f227 100644
--- a/Software/Visual_Studio/Tango.FileSystem/Network/FileSystemItemDTO.cs
+++ b/Software/Visual_Studio/Tango.FileSystem/Network/FileSystemItemDTO.cs
@@ -19,6 +19,8 @@ namespace Tango.FileSystem.Network
public DateTime DateModified { get; set; }
+ public DateTime DateCreated { get; set; }
+
public long Size { get; set; }
public bool IsRoot { get; set; }