Top navigation, search delete
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace FileTime.Core.ContentAccess;
|
||||
|
||||
public interface IContentProviderRegistry
|
||||
{
|
||||
IEnumerable<IContentProvider> ContentProviders { get; }
|
||||
ReadOnlyObservableCollection<IContentProvider> ContentProviders { get; }
|
||||
void AddContentProvider(IContentProvider contentProvider);
|
||||
void RemoveContentProvider(IContentProvider contentProvider);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace FileTime.Core.ContentAccess;
|
||||
|
||||
public interface IRootContentProvider : IContentProvider
|
||||
{
|
||||
|
||||
}
|
||||
@@ -4,25 +4,29 @@ public record FullName(string Path)
|
||||
{
|
||||
public FullName? GetParent()
|
||||
{
|
||||
if (Path.Length == 0) return null;
|
||||
var pathParts = Path.TrimEnd(Constants.SeparatorChar).Split(Constants.SeparatorChar);
|
||||
return pathParts.Length switch
|
||||
{
|
||||
> 1 => CreateSafe(string.Join(Constants.SeparatorChar, pathParts.SkipLast(1))),
|
||||
_ => null
|
||||
_ => CreateSafe("")
|
||||
};
|
||||
}
|
||||
|
||||
public static FullName? CreateSafe(string? path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
if (path is null)
|
||||
return null;
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
return new FullName("");
|
||||
|
||||
return new(path);
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
=> Path.Split(Constants.SeparatorChar).Last();
|
||||
|
||||
public FullName GetChild(string childName)
|
||||
public FullName GetChild(string childName)
|
||||
=> new(Path + Constants.SeparatorChar + childName);
|
||||
|
||||
public override string ToString() => Path;
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
namespace FileTime.Core.Models;
|
||||
|
||||
public readonly struct ItemInitializationSettings
|
||||
public sealed class ItemInitializationSettings
|
||||
{
|
||||
public readonly bool SkipChildInitialization;
|
||||
|
||||
public ItemInitializationSettings(bool skipChildInitialization)
|
||||
{
|
||||
SkipChildInitialization = skipChildInitialization;
|
||||
}
|
||||
public bool SkipChildInitialization { get; init; }
|
||||
public AbsolutePath? Parent { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user