Smb content provider
This commit is contained in:
@@ -55,6 +55,10 @@ namespace FileTime.Core.Components
|
||||
{
|
||||
CurrentSelectedItem = CurrentLocation.Items.FirstOrDefault(i => i.FullName == currentSelectedName) ?? currentLocation.Items.FirstOrDefault();
|
||||
}
|
||||
else if (CurrentLocation.Items.Count > 0)
|
||||
{
|
||||
CurrentSelectedItem = CurrentLocation.Items[0];
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectFirstItem()
|
||||
|
||||
7
src/Core/FileTime.Core/Interactions/IInputInterface.cs
Normal file
7
src/Core/FileTime.Core/Interactions/IInputInterface.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace FileTime.Core.Interactions
|
||||
{
|
||||
public interface IInputInterface
|
||||
{
|
||||
string?[] ReadInputs(IEnumerable<InputElement> fields);
|
||||
}
|
||||
}
|
||||
14
src/Core/FileTime.Core/Interactions/InputElement.cs
Normal file
14
src/Core/FileTime.Core/Interactions/InputElement.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace FileTime.Core.Interactions
|
||||
{
|
||||
public class InputElement
|
||||
{
|
||||
public string Text { get; }
|
||||
public InputType InputType { get; }
|
||||
|
||||
public InputElement(string text, InputType inputType)
|
||||
{
|
||||
Text = text;
|
||||
InputType = inputType;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/Core/FileTime.Core/Interactions/InputType.cs
Normal file
8
src/Core/FileTime.Core/Interactions/InputType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace FileTime.Core.Interactions
|
||||
{
|
||||
public enum InputType
|
||||
{
|
||||
Text,
|
||||
Password
|
||||
}
|
||||
}
|
||||
@@ -5,5 +5,9 @@ namespace FileTime.Core.Providers
|
||||
public interface IContentProvider : IContainer
|
||||
{
|
||||
IReadOnlyList<IContainer> RootContainers { get; }
|
||||
|
||||
bool CanHandlePath(string path);
|
||||
|
||||
void SetParent(IContainer container);
|
||||
}
|
||||
}
|
||||
54
src/Core/FileTime.Core/Providers/TopContainer.cs
Normal file
54
src/Core/FileTime.Core/Providers/TopContainer.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
using FileTime.Core.Models;
|
||||
|
||||
namespace FileTime.Core.Providers
|
||||
{
|
||||
public class TopContainer : IContainer
|
||||
{
|
||||
private readonly List<IContentProvider> _contentProviders;
|
||||
|
||||
public IReadOnlyList<IItem> Items => Containers;
|
||||
|
||||
public IReadOnlyList<IContainer> Containers { get; }
|
||||
|
||||
public IReadOnlyList<IElement> Elements { get; } = new List<IElement>().AsReadOnly();
|
||||
|
||||
public string Name => null;
|
||||
|
||||
public string? FullName => null;
|
||||
|
||||
public bool IsHidden => false;
|
||||
|
||||
public IContentProvider Provider => null;
|
||||
|
||||
public event EventHandler? Refreshed;
|
||||
|
||||
public TopContainer(IEnumerable<IContentProvider> contentProviders)
|
||||
{
|
||||
_contentProviders = new List<IContentProvider>(contentProviders);
|
||||
Containers = _contentProviders.AsReadOnly();
|
||||
|
||||
foreach (var contentProvider in contentProviders)
|
||||
{
|
||||
contentProvider.SetParent(this);
|
||||
}
|
||||
}
|
||||
|
||||
public IContainer CreateContainer(string name) => throw new NotImplementedException();
|
||||
|
||||
public IElement CreateElement(string name) => throw new NotImplementedException();
|
||||
|
||||
public void Delete() => throw new NotImplementedException();
|
||||
|
||||
public IItem? GetByPath(string path) => throw new NotImplementedException();
|
||||
|
||||
public IContainer? GetParent() => null;
|
||||
|
||||
public bool IsExists(string name) => throw new NotImplementedException();
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user