SMB, GUI imput handler, ThreadSafe SMB
This commit is contained in:
@@ -54,7 +54,10 @@ namespace FileTime.Core.Components
|
||||
IItem? itemToSelect = null;
|
||||
if (value != null)
|
||||
{
|
||||
itemToSelect = (await _currentLocation.GetItems())?.FirstOrDefault(i => i.FullName == value?.FullName);
|
||||
itemToSelect = (await _currentLocation.GetItems())?.FirstOrDefault(i =>
|
||||
i.FullName == null && value?.FullName == null
|
||||
? i.Name == value?.Name
|
||||
: i.FullName == value?.FullName);
|
||||
if (itemToSelect == null) throw new IndexOutOfRangeException("Provided item does not exists in the current container.");
|
||||
}
|
||||
|
||||
@@ -123,7 +126,7 @@ namespace FileTime.Core.Components
|
||||
|
||||
private async Task HandleCurrentLocationRefresh(object? sender, AsyncEventArgs e)
|
||||
{
|
||||
var currentSelectedName = (await GetCurrentSelectedItem())?.FullName ?? (await GetItemByLastPath()).FullName;
|
||||
var currentSelectedName = (await GetCurrentSelectedItem())?.FullName ?? (await GetItemByLastPath())?.FullName;
|
||||
var currentLocationItems = (await (await GetCurrentLocation()).GetItems())!;
|
||||
if (currentSelectedName != null)
|
||||
{
|
||||
|
||||
9
src/Core/FileTime.Core/Interactions/BasicInputHandler.cs
Normal file
9
src/Core/FileTime.Core/Interactions/BasicInputHandler.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace FileTime.Core.Interactions
|
||||
{
|
||||
public class BasicInputHandler : IInputInterface
|
||||
{
|
||||
public Func<IEnumerable<InputElement>, Task<string?[]>>? InputHandler { get; set; }
|
||||
public async Task<string?[]> ReadInputs(IEnumerable<InputElement> fields) =>
|
||||
InputHandler != null ? await InputHandler.Invoke(fields) : throw new NotImplementedException(nameof(InputHandler) + " is not set");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user