Base project

This commit is contained in:
2022-03-31 15:35:33 +00:00
parent 389c392899
commit ad5bedf339
35 changed files with 637 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using FileTime.Core.Enums;
using FileTime.Core.Models;
namespace FileTime.Core.Services
{
public abstract class ContentProviderBase : IContentProvider
{
protected List<IAbsolutePath> Items { get; set; } = new List<IAbsolutePath>();
IReadOnlyList<IAbsolutePath> IContainer.Items => Items;
public string Name { get; }
public string DisplayName { get; }
public FullName? FullName => null;
public NativePath? NativePath => null;
public bool IsHidden => false;
public bool IsExists => true;
public SupportsDelete CanDelete => SupportsDelete.False;
public bool CanRename => false;
public IContentProvider Provider => this;
protected ContentProviderBase(string name)
{
DisplayName = Name = name;
}
public virtual Task OnEnter() => Task.CompletedTask;
public virtual async Task<IItem> GetItemByFullNameAsync(FullName fullName) => await GetItemByNativePathAsync(GetNativePath(fullName));
public abstract Task<IItem> GetItemByNativePathAsync(NativePath nativePath);
public abstract Task<List<IAbsolutePath>> GetItemsByContainerAsync(FullName fullName);
public abstract NativePath GetNativePath(FullName fullName);
}
}

View File

@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Reactive" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FileTime.Core.Abstraction\FileTime.Core.Abstraction.csproj" />
<ProjectReference Include="..\FileTime.Core.Models\FileTime.Core.Models.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,7 @@
namespace FileTime.Core.Services
{
public class Tab : ITab
{
}
}