aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-17 05:14:20 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-17 05:14:20 +0200
commit062292c7b822247d74e4470dd8a509284b0d5eda (patch)
treedc77b89e254cc151b64c891b106afa9827f2c55d /Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
parent3bc7ddaf3b52eeae095e82e062156dde37e4805b (diff)
downloadTango-062292c7b822247d74e4470dd8a509284b0d5eda.tar.gz
Tango-062292c7b822247d74e4470dd8a509284b0d5eda.zip
Changes to file system monitoring.
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs32
1 files changed, 31 insertions, 1 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
index f9eff7e6f..20a960243 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
@@ -29,15 +29,27 @@ namespace Tango.FSE.PPCConsole.ViewModels
set { _currentPath = value; RaisePropertyChangedAuto(); }
}
+ private List<DriveItem> _drives;
+ public List<DriveItem> Drives
+ {
+ get { return _drives; }
+ set { _drives = value; RaisePropertyChangedAuto(); }
+ }
+
+
public RelayCommand NavigateCommand { get; set; }
public RelayCommand<FileSystemItem> OpenItemCommand { get; set; }
public RelayCommand BackCommand { get; set; }
+ public RelayCommand<String> NavigateSpecialFolderCommand { get; set; }
+ public RelayCommand<String> NavigateToFolderCommand { get; set; }
public FileSystemViewVM()
{
NavigateCommand = new RelayCommand(NavigateToCurrentPath);
OpenItemCommand = new RelayCommand<FileSystemItem>(OpenFileSystemItem);
BackCommand = new RelayCommand(NavigateBack, () => !(CurrentItem is FolderItem) || !(CurrentItem as FolderItem).IsRoot);
+ NavigateSpecialFolderCommand = new RelayCommand<string>(NavigateToSpecialFolder);
+ NavigateToFolderCommand = new RelayCommand<string>(async (x) => await Navigate(x));
}
private async void NavigateBack()
@@ -82,7 +94,13 @@ namespace Tango.FSE.PPCConsole.ViewModels
}
}
- private async Task Navigate(String path)
+ private async void NavigateToSpecialFolder(string folder)
+ {
+ Environment.SpecialFolder specialFolder = (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), folder);
+ await Navigate(null, specialFolder);
+ }
+
+ private async Task Navigate(String path, Environment.SpecialFolder? specialFolder = null)
{
try
{
@@ -94,9 +112,21 @@ namespace Tango.FSE.PPCConsole.ViewModels
{
CurrentItem = await FileSystemProvider.GetFolder(path) as FileSystemItem;
}
+ else if (specialFolder != null)
+ {
+ CurrentItem = await FileSystemProvider.GetSpecialFolder(specialFolder.Value) as FileSystemItem;
+ }
else
{
CurrentItem = await FileSystemProvider.GetThisPC() as FileSystemItem;
+ try
+ {
+ Drives = (CurrentItem as IFileSystemContainer).Items.Cast<DriveItem>().ToList();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error setting file system drives menu.");
+ }
}
}
catch (Exception ex)