Enter/Exit folder

This commit is contained in:
2022-04-11 22:09:32 +02:00
parent b6b8a7b3f8
commit 6245744612
56 changed files with 835 additions and 152 deletions

View File

@@ -3,6 +3,5 @@ namespace FileTime.Core.Models
public static class Constants
{
public const char SeparatorChar = '/';
public const int MaximumObservableMergeOperations = 4;
}
}

View File

@@ -6,7 +6,7 @@ namespace FileTime.Core.Models
{
if (Path is null) return null;
var pathParts = Path.Split(Constants.SeparatorChar);
var pathParts = Path.TrimEnd(Constants.SeparatorChar).Split(Constants.SeparatorChar);
return pathParts.Length switch
{
> 1 => new(string.Join(Constants.SeparatorChar, pathParts.SkipLast(1))),

View File

@@ -9,5 +9,7 @@ namespace FileTime.Core.Models
IContentProvider? VirtualContentProvider { get; }
FullName Path { get; }
AbsolutePathType Type { get; }
Task<IItem> ResolveAsync();
}
}

View File

@@ -9,7 +9,7 @@ namespace FileTime.Core.Models
string DisplayName { get; }
FullName? FullName { get; }
NativePath? NativePath { get; }
FullName? Parent { get; }
IAbsolutePath? Parent { get; }
bool IsHidden { get; }
bool IsExists { get; }
DateTime? CreatedAt { get; }

View File

@@ -0,0 +1,7 @@
namespace FileTime.Core.Models
{
public record ItemsTransformator(
string Name,
Func<IEnumerable<IItem>, Task<IEnumerable<IItem>>> Transformator
);
}

View File

@@ -1,5 +1,6 @@
using FileTime.Core.Models;
using InitableService;
using System.Reactive.Subjects;
namespace FileTime.Core.Services
{
@@ -9,6 +10,10 @@ namespace FileTime.Core.Services
IObservable<IAbsolutePath?> CurrentSelectedItem { get; }
IObservable<IEnumerable<IItem>> CurrentItems { get; }
void ChangeLocation(IContainer newLocation);
void SetCurrentLocation(IContainer newLocation);
void AddSelectedItemsTransformator(ItemsTransformator transformator);
void RemoveSelectedItemsTransformator(ItemsTransformator transformator);
void RemoveSelectedItemsTransformatorByName(string name);
void SetSelectedItem(IAbsolutePath newSelectedItem);
}
}