Enter/Exit folder
This commit is contained in:
@@ -3,6 +3,5 @@ namespace FileTime.Core.Models
|
||||
public static class Constants
|
||||
{
|
||||
public const char SeparatorChar = '/';
|
||||
public const int MaximumObservableMergeOperations = 4;
|
||||
}
|
||||
}
|
||||
@@ -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))),
|
||||
|
||||
@@ -9,5 +9,7 @@ namespace FileTime.Core.Models
|
||||
IContentProvider? VirtualContentProvider { get; }
|
||||
FullName Path { get; }
|
||||
AbsolutePathType Type { get; }
|
||||
|
||||
Task<IItem> ResolveAsync();
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FileTime.Core.Models
|
||||
{
|
||||
public record ItemsTransformator(
|
||||
string Name,
|
||||
Func<IEnumerable<IItem>, Task<IEnumerable<IItem>>> Transformator
|
||||
);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user