Console base WIP 2

This commit is contained in:
2023-08-07 17:52:47 +02:00
parent b9adbc8272
commit 9a63516aba
18 changed files with 193 additions and 79 deletions

View File

@@ -0,0 +1,19 @@
using System.Diagnostics;
using Serilog.Core;
using Serilog.Events;
namespace FileTime.ConsoleUI.App.Services;
public class CustomLoggerSink : ILogEventSink
{
public void Emit(LogEvent logEvent)
{
if (logEvent.Level >= LogEventLevel.Error)
{
var message = logEvent.RenderMessage();
if (logEvent.Exception is not null)
message += $" {logEvent.Exception.Message}";
Debug.WriteLine(message);
}
}
}

View File

@@ -0,0 +1,18 @@
using FileTime.App.Core.Services;
using FileTime.Core.Models;
using Terminal.Gui;
namespace FileTime.ConsoleUI.App.Services;
public class SystemClipboardService : ISystemClipboardService
{
public Task CopyToClipboardAsync(string text)
{
Clipboard.TrySetClipboardData(text);
return Task.CompletedTask;
}
public Task<IEnumerable<FullName>> GetFilesAsync() => throw new NotImplementedException();
public Task SetFilesAsync(IEnumerable<FullName> files) => throw new NotImplementedException();
}