Add temporary remove all monitoring paths for IO-996.
This commit is contained in:
@@ -70,13 +70,38 @@ namespace BodyshopPartner.ViewModels
|
||||
{
|
||||
_removeMonitoringPathCommand = new RelayCommand(
|
||||
p => true,
|
||||
p => RemoveFolderMonitoringPath(p as Models.Monitor)
|
||||
p =>
|
||||
{
|
||||
RemoveFolderMonitoringPath(p as Models.Monitor);
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
return _removeMonitoringPathCommand;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand _removeAllMonitoringPathCommand;
|
||||
public ICommand RemoveAllMonitoringPathCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_removeAllMonitoringPathCommand == null)
|
||||
{
|
||||
_removeAllMonitoringPathCommand = new RelayCommand(
|
||||
p => true,
|
||||
p =>
|
||||
{
|
||||
RemoveAllFolderMonitors();
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
return _removeAllMonitoringPathCommand;
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _startFolderMonitorsCommand;
|
||||
public ICommand StartFolderMonitorsCommand
|
||||
{
|
||||
|
||||
@@ -179,6 +179,24 @@ namespace BodyshopPartner.ViewModels
|
||||
IndeterminateLoading = false;
|
||||
}
|
||||
|
||||
|
||||
public void RemoveAllFolderMonitors()
|
||||
{
|
||||
IndeterminateLoading = true;
|
||||
if (MonitoringPaths.Count > 0)
|
||||
foreach (var m in MonitoringPaths.ToList())
|
||||
{
|
||||
logger.Debug("Removing folder {0} to monitoring paths.", m.FilePath);
|
||||
m.StopMonitor();
|
||||
MonitoringPaths.Remove(m);
|
||||
|
||||
}
|
||||
Properties.Settings.Default.MonitoringPaths = MonitoringPaths.Select(x => x.FilePath).ToList();
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
IndeterminateLoading = false;
|
||||
}
|
||||
|
||||
public void BrowseForQbFolder()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user