New reactive core WIP
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user