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

@@ -23,17 +23,10 @@ public record Container(
IContentProvider Provider,
bool AllowRecursiveDeletion,
PointInTime PointInTime,
IObservable<IChangeSet<Exception>> Exceptions,
ObservableCollection<Exception> Exceptions,
ReadOnlyExtensionCollection Extensions,
IObservable<IChangeSet<AbsolutePath, string>> Items) : IContainer
ObservableCollection<AbsolutePath> Items) : IContainer
{
private readonly Lazy<ReadOnlyObservableCollection<AbsolutePath>> _itemsCollectionLazy =
new(() =>
{
Items.Bind(out var items).Subscribe();
return items;
});
private readonly CancellationTokenSource _loadingCancellationTokenSource = new();
private readonly BehaviorSubject<bool> _isLoading = new(false);
@@ -42,8 +35,6 @@ public record Container(
public bool? IsLoaded { get; private set; }
public AbsolutePathType Type => AbsolutePathType.Container;
public ReadOnlyObservableCollection<AbsolutePath> ItemsCollection => _itemsCollectionLazy.Value;
public async Task WaitForLoaded(CancellationToken token = default)
{
while (IsLoaded != true) await Task.Delay(1, token);

View File

@@ -1,3 +1,4 @@
using System.Collections.ObjectModel;
using DynamicData;
using FileTime.Core.ContentAccess;
using FileTime.Core.Enums;
@@ -19,7 +20,7 @@ public record Element(
string? Attributes,
IContentProvider Provider,
PointInTime PointInTime,
IObservable<IChangeSet<Exception>> Exceptions,
ObservableCollection<Exception> Exceptions,
ReadOnlyExtensionCollection Extensions) : IElement
{
public AbsolutePathType Type => AbsolutePathType.Element;