diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-25 17:52:49 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-25 17:52:49 +0200 |
| commit | 9277bbd2fa070c69b83904f8fe5628fab2b947b8 (patch) | |
| tree | 3099f9ce92f04c28517eb13938e913a1e376b3fe /Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs | |
| parent | f779e2b6f0bb1dedc7644c64651b59e31ce62c00 (diff) | |
| download | Tango-9277bbd2fa070c69b83904f8fe5628fab2b947b8.tar.gz Tango-9277bbd2fa070c69b83904f8fe5628fab2b947b8.zip | |
Working on job export import to storage.
Diffstat (limited to 'Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs index 48f870b20..dde105767 100644 --- a/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs @@ -12,7 +12,7 @@ namespace Tango.Explorer { public class ExplorerFolderItem : ExplorerItem { - private static List<String> extensions = ExplorerFileDefinition.GetSupportedExtensions().Select(x => x.Replace(".","")).ToList(); + private static List<String> extensions = ExplorerFileDefinition.GetSupportedExtensions().Select(x => x.Replace(".", "")).ToList(); public List<ExplorerItem> Items { get; set; } @@ -21,7 +21,7 @@ namespace Tango.Explorer Items = new List<ExplorerItem>(); } - public static ExplorerFolderItem LoadFromPath(String path) + public static ExplorerFolderItem LoadFromPath(String path, String filter) { ExplorerFolderItem folderItem = new ExplorerFolderItem(); @@ -38,9 +38,12 @@ namespace Tango.Explorer folderItem.Items.Add(fItem); } - foreach (var file in Directory.GetFiles(path,"*.*").Where(f => extensions.Contains(f.Split('.').Last().ToLower())).ToArray()) + foreach (var file in Directory.GetFiles(path, "*.*").Where(f => extensions.Contains(f.Split('.').Last().ToLower())).ToArray()) { - folderItem.Items.Add(ExplorerFileItem.LoadFromPath(file)); + if (filter == null || filter.ToLower().Replace("*", "").Replace(";", "").Split('|').Contains(System.IO.Path.GetExtension(file).ToLower())) + { + folderItem.Items.Add(ExplorerFileItem.LoadFromPath(file)); + } } return folderItem; |
