Release 0.4.8 with Android file imports
This commit is contained in:
1 parent
b600412285
commit
3dfeef54ea
9 files changed
+328
-32
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace LMEMappeCatastaliApp.Services;
|
||||
|
||||
public sealed class IncomingFileService
|
||||
{
|
||||
private readonly ConcurrentQueue<IncomingFile> _files = new();
|
||||
public static IncomingFileService Shared { get; } = new();
|
||||
public event Action? FileAvailable;
|
||||
|
||||
public void Enqueue(IncomingFile file)
|
||||
{
|
||||
_files.Enqueue(file);
|
||||
MainThread.BeginInvokeOnMainThread(() => FileAvailable?.Invoke());
|
||||
}
|
||||
|
||||
public bool TryDequeue(out IncomingFile? file) => _files.TryDequeue(out file);
|
||||
}
|
||||
|
||||
public sealed record IncomingFile(string Path, string FileName, string? ContentType);
|
||||
Reference in new issue
Block a user