Class ClipboardService
- Namespace
- NuvTools.AspNetCore.Blazor.JSInterop
- Assembly
- NuvTools.AspNetCore.Blazor.dll
Provides JavaScript interop functionality for clipboard operations.
public sealed class ClipboardService : IClipboardService
- Inheritance
-
ClipboardService
- Implements
- Inherited Members
Remarks
Initializes a new instance of the ClipboardService class.
Constructors
ClipboardService(IJSRuntime)
Provides JavaScript interop functionality for clipboard operations.
public ClipboardService(IJSRuntime jsRuntime)
Parameters
jsRuntimeIJSRuntimeThe JavaScript runtime for interop operations.
Remarks
Initializes a new instance of the ClipboardService class.
Methods
ReadTextAsync()
Reads text from the system clipboard asynchronously.
public ValueTask<string> ReadTextAsync()
Returns
- ValueTask<string>
A ValueTask<TResult> representing the asynchronous operation, containing the clipboard text.
WriteTextAsync(string)
Writes text to the system clipboard asynchronously.
public ValueTask WriteTextAsync(string text)
Parameters
textstringThe text to write to the clipboard.