From 52813618e140c921ff653d9c227c35032207b495 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 15 Apr 2020 04:54:52 +0300 Subject: FSE Firmware FileSystem. --- .../Tango.FileSystem/FileSystemItem.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs') diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs index 558251f3c..c78a11732 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemItem.cs @@ -84,5 +84,26 @@ namespace Tango.FileSystem 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; + } + } } } -- cgit v1.3.1