mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-23 04:52:22 +00:00
19 lines
455 B
C#
19 lines
455 B
C#
using Microsoft.JSInterop;
|
|
|
|
namespace Lantean.QBTMud.Services
|
|
{
|
|
public class ClipboardService : IClipboardService
|
|
{
|
|
private readonly IJSRuntime _jSRuntime;
|
|
|
|
public ClipboardService(IJSRuntime jSRuntime)
|
|
{
|
|
_jSRuntime = jSRuntime;
|
|
}
|
|
|
|
public async Task WriteToClipboard(string text)
|
|
{
|
|
await _jSRuntime.InvokeVoidAsync("navigator.clipboard.writeText", text);
|
|
}
|
|
}
|
|
} |