Search WIP

This commit is contained in:
2023-02-27 08:41:19 +01:00
parent 64d7634b1b
commit a01c3a69b4
16 changed files with 128 additions and 100 deletions

View File

@@ -10,11 +10,12 @@ namespace FileTime.Core.ContentAccess;
public abstract class ContentProviderBase : IContentProvider
{
private readonly ReadOnlyExtensionCollection _extensions;
private readonly IObservable<IChangeSet<AbsolutePath, string>> _items;
protected BehaviorSubject<IObservable<IChangeSet<AbsolutePath, string>>?> Items { get; } = new(null);
protected SourceCache<AbsolutePath, string> Items { get; } = new(p => p.Path.Path);
protected ExtensionCollection Extensions { get; }
IObservable<IObservable<IChangeSet<AbsolutePath, string>>?> IContainer.Items => Items;
IObservable<IChangeSet<AbsolutePath, string>> IContainer.Items => _items;
public string Name { get; }
@@ -59,6 +60,7 @@ public abstract class ContentProviderBase : IContentProvider
FullName = FullName.CreateSafe(name);
Extensions = new ExtensionCollection();
_extensions = Extensions.AsReadOnly();
_items = Items.Connect().StartWithEmpty();
}
public virtual Task OnEnter() => Task.CompletedTask;