New reactive core WIP

This commit is contained in:
2023-07-21 22:15:48 +02:00
parent 342fc0d047
commit b61c204e49
61 changed files with 1605 additions and 413 deletions

View File

@@ -21,6 +21,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Library\DeclarativeProperty\DeclarativeProperty.csproj" />
<ProjectReference Include="..\..\Library\InitableService\InitableService.csproj" />
</ItemGroup>

View File

@@ -5,8 +5,7 @@ namespace FileTime.Core.Models;
public interface IContainer : IItem
{
IObservable<IChangeSet<AbsolutePath, string>> Items { get; }
ReadOnlyObservableCollection<AbsolutePath> ItemsCollection { get; }
ObservableCollection<AbsolutePath> Items { get; }
IObservable<bool> IsLoading { get; }
bool? IsLoaded { get; }
Task WaitForLoaded(CancellationToken token = default);

View File

@@ -1,3 +1,4 @@
using System.Collections.ObjectModel;
using DynamicData;
using FileTime.Core.ContentAccess;
using FileTime.Core.Enums;
@@ -21,7 +22,7 @@ public interface IItem
string? Attributes { get; }
AbsolutePathType Type { get; }
PointInTime PointInTime { get; }
IObservable<IChangeSet<Exception>> Exceptions { get; }
ObservableCollection<Exception> Exceptions { get; }
ReadOnlyExtensionCollection Extensions { get; }
T? GetExtension<T>() => (T?)Extensions.FirstOrDefault(i => i is T);

View File

@@ -1,20 +1,22 @@
using System.Collections.ObjectModel;
using DeclarativeProperty;
using DynamicData;
using FileTime.Core.Models;
using InitableService;
namespace FileTime.Core.Services;
public interface ITab : IInitable<IContainer>, IDisposable
public interface ITab : IAsyncInitable<IContainer>, IDisposable
{
IObservable<IContainer?> CurrentLocation { get; }
IObservable<AbsolutePath?> CurrentSelectedItem { get; }
IObservable<IObservable<IChangeSet<IItem, string>>?> CurrentItems { get; }
public IDeclarativeProperty<IContainer?> CurrentLocation { get; }
public IDeclarativeProperty<ObservableCollection<IItem>?> CurrentItems { get; }
public IDeclarativeProperty<AbsolutePath?> CurrentSelectedItem { get; }
FullName? LastDeepestSelectedPath { get; }
void SetCurrentLocation(IContainer newLocation);
Task SetCurrentLocation(IContainer newLocation);
void AddItemFilter(ItemFilter filter);
void RemoveItemFilter(ItemFilter filter);
void RemoveItemFilter(string name);
void SetSelectedItem(AbsolutePath newSelectedItem);
void ForceSetCurrentLocation(IContainer newLocation);
Task SetSelectedItem(AbsolutePath newSelectedItem);
Task ForceSetCurrentLocation(IContainer newLocation);
}