Item Attributes

This commit is contained in:
2022-04-01 21:46:55 +02:00
parent 70afc3880e
commit 7ff3898bd9
22 changed files with 178 additions and 40 deletions

View File

@@ -2,6 +2,6 @@ namespace FileTime.Core.Models
{
public interface IFileElement : IElement
{
long Size { get; }
}
}

View File

@@ -12,8 +12,10 @@ namespace FileTime.Core.Models
FullName? Parent { get; }
bool IsHidden { get; }
bool IsExists { get; }
DateTime? CreatedAt { get; }
SupportsDelete CanDelete { get; }
bool CanRename { get; }
IContentProvider Provider { get; }
string? Attributes { get; }
}
}

View File

@@ -3,16 +3,18 @@ using FileTime.Core.Services;
namespace FileTime.Core.Models
{
public record Container
(string Name,
public record Container(
string Name,
string DisplayName,
FullName FullName,
NativePath NativePath,
FullName Parent,
bool IsHidden,
bool IsExists,
DateTime? CreatedAt,
SupportsDelete CanDelete,
bool CanRename,
string? Attributes,
IContentProvider Provider,
IReadOnlyList<IAbsolutePath> Items) : IContainer;
}

View File

@@ -3,15 +3,17 @@ using FileTime.Core.Services;
namespace FileTime.Core.Models
{
public record Element
(string Name,
public record Element(
string Name,
string DisplayName,
FullName FullName,
NativePath NativePath,
FullName Parent,
bool IsHidden,
bool IsExists,
DateTime? CreatedAt,
SupportsDelete CanDelete,
bool CanRename,
string? Attributes,
IContentProvider Provider) : IElement;
}

View File

@@ -0,0 +1,34 @@
using FileTime.Core.Enums;
using FileTime.Core.Services;
namespace FileTime.Core.Models
{
public record FileElement(
string Name,
string DisplayName,
FullName FullName,
NativePath NativePath,
FullName Parent,
bool IsHidden,
bool IsExists,
DateTime? CreatedAt,
SupportsDelete CanDelete,
bool CanRename,
string? Attributes,
IContentProvider Provider,
long Size)
: Element(
Name,
DisplayName,
FullName,
NativePath,
Parent,
IsHidden,
IsExists,
CreatedAt,
CanDelete,
CanRename,
Attributes,
Provider
), IFileElement;
}

View File

@@ -29,6 +29,10 @@ namespace FileTime.Core.Services
public FullName? Parent => null;
public DateTime? CreatedAt => null;
public string? Attributes => null;
protected ContentProviderBase(string name)
{
DisplayName = Name = name;

View File

@@ -40,11 +40,6 @@ namespace FileTime.Core.Services
)
.Merge(Constants.MaximumObservableMergeOperations);
CurrentSelectedItem = CurrentLocation.Select(GetSelectedItemByLocation).Merge(_currentSelectedItem).Throttle(TimeSpan.FromMilliseconds(500));
CurrentItems.Subscribe(c =>
{
;
});
}
public void Init(IContainer currentLocation)