ContentAccess namespace refactor

This commit is contained in:
2022-05-23 18:30:39 +02:00
parent d4bd9d3ba1
commit 4ac99480fa
24 changed files with 49 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ using System.Reactive.Linq;
using FileTime.App.Core.ViewModels;
using FileTime.App.Core.ViewModels.ItemPreview;
using FileTime.Core.Models;
using InitableService;
using Microsoft.Extensions.DependencyInjection;
namespace FileTime.App.Core.Services;

View File

@@ -25,6 +25,7 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
private readonly ICommandScheduler _commandScheduler;
private readonly BindedCollection<FullName>? _markedItems;
private PointInTime _currentPointInTime;
private IContainer? _currentLocation;
public ItemManipulationUserCommandHandlerService(
IAppState appState,
@@ -44,6 +45,7 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
_currentPointInTime = null!;
SaveSelectedTab(t => _selectedTab = t);
SaveCurrentLocation(l => _currentLocation = l);
SaveCurrentSelectedItem(i => _currentSelectedItem = i);
SaveCurrentPointInTime(t => _currentPointInTime = t);
@@ -130,7 +132,9 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
//TODO: message on empty result
var newContainerName = containerNameInput.Value;
var command = new CreateContainerCommand();
if (_currentLocation?.FullName is null || newContainerName is null) return;
var command = new CreateContainerCommand(_currentLocation.FullName, newContainerName, _timelessContentProvider);
await _commandScheduler.AddCommand(command);
}
}

View File

@@ -6,6 +6,7 @@ using FileTime.Core.Models;
using FileTime.Core.Services;
using FileTime.Core.Timeline;
using FileTime.Providers.Local;
using InitableService;
using Microsoft.Extensions.DependencyInjection;
namespace FileTime.App.Core.Services.UserCommandHandler;