Modern UI, Loading screen CanRunMessages

This commit is contained in:
2022-02-03 16:49:45 +01:00
parent 1319d0bb98
commit 2ff1aa366e
34 changed files with 913 additions and 563 deletions

View File

@@ -20,6 +20,7 @@ namespace FileTime.Core.Models
Task<bool> CanOpen();
bool IsLoaded { get; }
bool SupportsDirectoryLevelSoftDelete { get; }
AsyncEventHandler Refreshed { get; }
}

View File

@@ -7,10 +7,10 @@ namespace FileTime.Core.Models
string Name { get; }
string? FullName { get; }
bool IsHidden { get; }
bool CanDelete { get; }
SupportsDelete CanDelete { get; }
bool CanRename { get; }
IContentProvider Provider { get; }
Task Delete();
Task Delete(bool hardDelete = false);
Task Rename(string newName);
IContainer? GetParent();
}

View File

@@ -0,0 +1,9 @@
namespace FileTime.Core.Models
{
public enum SupportsDelete
{
True,
HardDeleteOnly,
False
}
}

View File

@@ -25,12 +25,14 @@ namespace FileTime.Core.Models
public bool IsHidden => BaseContainer.IsHidden;
public bool IsLoaded => BaseContainer.IsLoaded;
public bool CanDelete => BaseContainer.CanDelete;
public SupportsDelete CanDelete => BaseContainer.CanDelete;
public bool CanRename => BaseContainer.CanRename;
public IContentProvider Provider => BaseContainer.Provider;
public IReadOnlyList<Exception> Exceptions => BaseContainer.Exceptions;
public bool SupportsDirectoryLevelSoftDelete => BaseContainer.SupportsDirectoryLevelSoftDelete;
public AsyncEventHandler Refreshed { get; }
private void RefreshAddBase(Func<object?, AsyncEventArgs, Task> handler)
@@ -151,7 +153,7 @@ namespace FileTime.Core.Models
return Task.FromResult(Elements);
}
public async Task Delete() => await BaseContainer.Delete();
public async Task Delete(bool hardDelete = false) => await BaseContainer.Delete();
public async Task<IContainer> Clone()
{
return new VirtualContainer(