Admin mode WIP
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\FileTime.Core.Abstraction\FileTime.Core.Abstraction.csproj" />
|
||||
<ProjectReference Include="..\..\Core\FileTime.Core.ContentAccess\FileTime.Core.ContentAccess.csproj" />
|
||||
<ProjectReference Include="..\FileTime.Providers.Remote.Abstractions\FileTime.Providers.Remote.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,24 @@
|
||||
using FileTime.Core.ContentAccess;
|
||||
using FileTime.Core.Enums;
|
||||
using FileTime.Core.Models;
|
||||
using FileTime.Core.Timeline;
|
||||
|
||||
namespace FileTime.Providers.Remote;
|
||||
|
||||
public class RemoteContentProvider : ContentProviderBase, IRemoteContentProvider
|
||||
{
|
||||
public RemoteContentProvider(string remoteName, string name = "remote") : base(name)
|
||||
{
|
||||
}
|
||||
|
||||
//TODO implement
|
||||
public override Task<IItem> GetItemByNativePathAsync(NativePath nativePath, PointInTime pointInTime, bool forceResolve = false, AbsolutePathType forceResolvePathType = AbsolutePathType.Unknown, ItemInitializationSettings itemInitializationSettings = default) => throw new NotImplementedException();
|
||||
|
||||
public override NativePath GetNativePath(FullName fullName) => throw new NotImplementedException();
|
||||
|
||||
public override FullName GetFullName(NativePath nativePath) => throw new NotImplementedException();
|
||||
|
||||
public override Task<byte[]?> GetContentAsync(IElement element, int? maxLength = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
||||
|
||||
public override bool CanHandlePath(NativePath path) => throw new NotImplementedException();
|
||||
}
|
||||
24
src/Providers/FileTime.Providers.Remote/RemoteItemCreator.cs
Normal file
24
src/Providers/FileTime.Providers.Remote/RemoteItemCreator.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using FileTime.Core.ContentAccess;
|
||||
using FileTime.Core.Models;
|
||||
using FileTime.Server.Common;
|
||||
|
||||
namespace FileTime.Providers.Remote;
|
||||
|
||||
public class RemoteItemCreator :
|
||||
ItemCreatorBase<IRemoteContentProvider>,
|
||||
IRemoteItemCreator
|
||||
{
|
||||
private IRemoteConnection _remoteConnection = null!;
|
||||
private string _remoteContentProviderId = null!;
|
||||
public void Init(IRemoteConnection remoteConnection, string remoteContentProviderId)
|
||||
{
|
||||
_remoteConnection = remoteConnection;
|
||||
_remoteContentProviderId = remoteContentProviderId;
|
||||
}
|
||||
|
||||
public override async Task CreateContainerAsync(IRemoteContentProvider contentProvider, FullName fullName)
|
||||
=> await _remoteConnection.CreateContainerAsync(_remoteContentProviderId, fullName);
|
||||
|
||||
public override async Task CreateElementAsync(IRemoteContentProvider contentProvider, FullName fullName)
|
||||
=> await _remoteConnection.CreateElementAsync(_remoteContentProviderId, fullName);
|
||||
}
|
||||
16
src/Providers/FileTime.Providers.Remote/Startup.cs
Normal file
16
src/Providers/FileTime.Providers.Remote/Startup.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
namespace FileTime.Providers.Remote;
|
||||
|
||||
public static class Startup
|
||||
{
|
||||
|
||||
public static IServiceCollection AddRemoteProviderServices(this IServiceCollection serviceCollection)
|
||||
{
|
||||
serviceCollection.TryAddSingleton<IRemoteContentProvider, RemoteContentProvider>();
|
||||
serviceCollection.TryAddTransient<IRemoteItemCreator, RemoteItemCreator>();
|
||||
return serviceCollection;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user