### Dependency Injection Setup Source: https://github.com/copytext/textcopy/blob/main/readme.md This extension method registers the Clipboard service with the service collection for dependency injection. Use IClipboard for injection. ```cs serviceCollection.InjectClipboard(); ``` -------------------------------- ### Get Text Synchronously Source: https://github.com/copytext/textcopy/blob/main/readme.md Use this method to synchronously retrieve text from the system clipboard. Ensure the ClipboardService is accessible. ```cs var text = ClipboardService.GetText(); ``` -------------------------------- ### Get Text Asynchronously Source: https://github.com/copytext/textcopy/blob/main/readme.md Use this method to asynchronously retrieve text from the system clipboard. Ensure the ClipboardService is accessible. ```cs var text = await ClipboardService.GetTextAsync(); ``` -------------------------------- ### Using IClipboard with Dependency Injection Source: https://context7.com/copytext/textcopy/llms.txt Demonstrates how to set up and use the `IClipboard` interface with dependency injection in a .NET application. This allows for easy testing by swapping in a mock implementation. ```csharp using TextCopy; using Microsoft.Extensions.DependencyInjection; // --- Production setup --- var services = new ServiceCollection(); services.InjectClipboard(); // registers Clipboard as IClipboard singleton var provider = services.BuildServiceProvider(); IClipboard clipboard = provider.GetRequiredService(); clipboard.SetText("Injected clipboard write"); Console.WriteLine(await clipboard.GetTextAsync()); // Output: Injected clipboard write // --- Consumer component --- public class MyFeature { readonly IClipboard _clipboard; public MyFeature(IClipboard clipboard) => _clipboard = clipboard; public async Task CopyReport(string report) { await _clipboard.SetTextAsync(report); Console.WriteLine("Report copied to clipboard."); } public async Task PasteReport() { return await _clipboard.GetTextAsync(); } } ``` -------------------------------- ### Instance API Set Text Source: https://github.com/copytext/textcopy/blob/main/readme.md Demonstrates using the instance API of the Clipboard class to set text. An instance must be created first. ```cs Clipboard clipboard = new(); clipboard.SetText("Text to place in clipboard"); ``` -------------------------------- ### Instance API - SetText Source: https://github.com/copytext/textcopy/blob/main/readme.md Demonstrates using an instance of Clipboard to set text. ```APIDOC ## Instance API - SetText ### Description This shows how to use an instance of the `Clipboard` class to set the clipboard text. ### Method `SetText` on a `Clipboard` instance ### Endpoint N/A (SDK Method) ### Parameters #### Request Body - **text** (string) - The text to be placed in the clipboard. ### Request Example ```cs Clipboard clipboard = new(); clipboard.SetText("Text to place in clipboard"); ``` ### Response #### Success Response None (void) #### Response Example None ``` -------------------------------- ### Registering Clipboard with Dependency Injection Source: https://context7.com/copytext/textcopy/llms.txt Shows how to use the `InjectClipboard` extension method to register `IClipboard` with `IServiceCollection`. This method automatically resolves the correct clipboard implementation for the current platform. ```csharp // Console / ASP.NET Core setup using TextCopy; using Microsoft.Extensions.DependencyInjection; var services = new ServiceCollection(); services.InjectClipboard(); var app = services.BuildServiceProvider(); var clipboard = app.GetRequiredService(); await clipboard.SetTextAsync("Registered via DI"); ``` ```csharp // Blazor WebAssembly Program.cs using BlazorSample; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using TextCopy; var builder = WebAssemblyHostBuilder.CreateDefault(); var serviceCollection = builder.Services; serviceCollection.InjectClipboard(); // resolves to BlazorClipboard in the browser builder.RootComponents.Add("app"); builder.RootComponents.Add("head::after"); await builder.Build().RunAsync(); ``` -------------------------------- ### Registering a No-Op Clipboard for Testing Source: https://context7.com/copytext/textcopy/llms.txt Demonstrates how to use `InjectMockClipboard` to register a `MockClipboard` for unit testing. This implementation ensures clipboard operations do not interact with the real system clipboard. ```csharp using TextCopy; using Microsoft.Extensions.DependencyInjection; // In a test project setup var services = new ServiceCollection(); services.InjectMockClipboard(); // no real clipboard interactions var provider = services.BuildServiceProvider(); IClipboard clipboard = provider.GetRequiredService(); // SetText and SetTextAsync are silent no-ops clipboard.SetText("This is never written to the real clipboard"); await clipboard.SetTextAsync("Neither is this"); // GetText and GetTextAsync always return null string? result = clipboard.GetText(); Console.WriteLine(result is null ? "null (as expected)" : result); // Output: null (as expected) // You can also subclass MockClipboard to track calls in tests public class TrackingClipboard : MockClipboard { public List Written { get; } = new(); public override void SetText(string text) => Written.Add(text); public override Task SetTextAsync(string text, CancellationToken cancellation = default) { Written.Add(text); return Task.CompletedTask; } } ``` -------------------------------- ### Instance-based clipboard access with Clipboard class Source: https://context7.com/copytext/textcopy/llms.txt Utilize the `Clipboard` class for instance-based clipboard operations, implementing `IClipboard`. This is beneficial for dependency injection or testing scenarios. It provides synchronous and asynchronous methods for reading and writing text. ```csharp using TextCopy; // Create and use directly Clipboard clipboard = new(); clipboard.SetText("Instance-based write"); string? result = clipboard.GetText(); Console.WriteLine(result); // Output: Instance-based write // Async via instance await clipboard.SetTextAsync("Async via instance"); string? asyncResult = await clipboard.GetTextAsync(); Console.WriteLine(asyncResult); // Output: Async via instance ``` -------------------------------- ### Dependency Injection - InjectClipboard Source: https://github.com/copytext/textcopy/blob/main/readme.md Shows how to inject an instance of `Clipboard` into `IServiceCollection`. ```APIDOC ## Dependency Injection - InjectClipboard ### Description This demonstrates how to register and inject an instance of `Clipboard` using dependency injection, typically with `IServiceCollection`. ### Method `InjectClipboard` extension method ### Endpoint N/A (SDK Method) ### Parameters None ### Request Example ```cs serviceCollection.InjectClipboard(); ``` ### Response #### Success Response None (void) #### Response Example None ``` -------------------------------- ### ServiceExtensions.InjectMockClipboard Source: https://context7.com/copytext/textcopy/llms.txt Registers a MockClipboard singleton for testing purposes. This implementation provides no-op clipboard operations, ensuring tests do not interact with the actual system clipboard. ```APIDOC ## `ServiceExtensions.InjectMockClipboard` — Register a no-op clipboard for testing `InjectMockClipboard` registers a `MockClipboard` singleton — an `IClipboard` implementation where all methods are no-ops (writes are silently discarded, reads always return `null`). It is designed to be used in unit test setups so clipboard operations do not interact with the real system clipboard. ```csharp using TextCopy; using Microsoft.Extensions.DependencyInjection; // In a test project setup var services = new ServiceCollection(); services.InjectMockClipboard(); // no real clipboard interactions var provider = services.BuildServiceProvider(); IClipboard clipboard = provider.GetRequiredService(); // SetText and SetTextAsync are silent no-ops clipboard.SetText("This is never written to the real clipboard"); await clipboard.SetTextAsync("Neither is this"); // GetText and GetTextAsync always return null string? result = clipboard.GetText(); Console.WriteLine(result is null ? "null (as expected)" : result); // Output: null (as expected) // You can also subclass MockClipboard to track calls in tests public class TrackingClipboard : MockClipboard { public List Written { get; } = new(); public override void SetText(string text) => Written.Add(text); public override Task SetTextAsync(string text, CancellationToken cancellation = default) { Written.Add(text); return Task.CompletedTask; } } ``` ``` -------------------------------- ### Clipboard (Instance-based) Source: https://context7.com/copytext/textcopy/llms.txt Provides instance-based access to clipboard operations (SetText, SetTextAsync, GetText, GetTextAsync) implementing the IClipboard interface. Useful for dependency injection. ```APIDOC ## Clipboard — Instance-based clipboard access ### Description The `Clipboard` class is the concrete instance implementation of `IClipboard`. It provides the same `SetText`, `SetTextAsync`, `GetText`, and `GetTextAsync` methods as the static service but as instance methods, which is useful when you need to pass clipboard access as a dependency or override behavior in tests. ### Methods - `SetText(string text)`: Writes text synchronously. - `SetTextAsync(string text, CancellationToken cancellationToken = default)`: Writes text asynchronously. - `GetText(CancellationToken cancellationToken = default)`: Reads text synchronously. - `GetTextAsync(CancellationToken cancellationToken = default)`: Reads text asynchronously. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp using TextCopy; // Create and use directly Clipboard clipboard = new(); clipboard.SetText("Instance-based write"); string? result = clipboard.GetText(); Console.WriteLine(result); // Output: Instance-based write // Async via instance await clipboard.SetTextAsync("Async via instance"); string? asyncResult = await clipboard.GetTextAsync(); Console.WriteLine(asyncResult); // Output: Async via instance ``` ### Response #### Success Response (void/string?) Methods return void for Set operations and `string?` for Get operations. #### Response Example ```json "Instance-based write" ``` ``` -------------------------------- ### ServiceExtensions.InjectClipboard Source: https://context7.com/copytext/textcopy/llms.txt Registers a singleton IClipboard instance with the service collection. This method automatically resolves the appropriate clipboard implementation based on the runtime environment. ```APIDOC ## `ServiceExtensions.InjectClipboard` — Register clipboard with dependency injection The `InjectClipboard` extension method on `IServiceCollection` registers a singleton `IClipboard` instance that is automatically resolved for the current platform: a standard `Clipboard` on desktop/mobile, or a `BlazorClipboard` backed by JSInterop when running in a browser (Blazor WebAssembly). ```csharp // Console / ASP.NET Core setup using TextCopy; using Microsoft.Extensions.DependencyInjection; var services = new ServiceCollection(); services.InjectClipboard(); var app = services.BuildServiceProvider(); var clipboard = app.GetRequiredService(); await clipboard.SetTextAsync("Registered via DI"); // Blazor WebAssembly Program.cs using BlazorSample; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using TextCopy; var builder = WebAssemblyHostBuilder.CreateDefault(); var serviceCollection = builder.Services; serviceCollection.InjectClipboard(); // resolves to BlazorClipboard in the browser builder.RootComponents.Add("app"); builder.RootComponents.Add("head::after"); await builder.Build().RunAsync(); ``` ``` -------------------------------- ### Configure Blazor WebAssembly Clipboard Service Source: https://github.com/copytext/textcopy/blob/main/readme.md Inject the IClipboard service into your Blazor WebAssembly application's service collection during startup. This is necessary because the static ClipboardService is not supported due to JSInterop dependencies. ```csharp var builder = WebAssemblyHostBuilder.CreateDefault(); var serviceCollection = builder.Services; serviceCollection.InjectClipboard(); builder.RootComponents.Add("app"); ``` -------------------------------- ### Set Text Synchronously Source: https://github.com/copytext/textcopy/blob/main/readme.md Use this method to synchronously place text into the system clipboard. Ensure the ClipboardService is accessible. ```cs ClipboardService.SetText("Text to place in clipboard"); ``` -------------------------------- ### Set Text Asynchronously Source: https://github.com/copytext/textcopy/blob/main/readme.md Use this method to asynchronously place text into the system clipboard. Ensure the ClipboardService is accessible. ```cs await ClipboardService.SetTextAsync("Text to place in clipboard"); ``` -------------------------------- ### IClipboard Interface Source: https://context7.com/copytext/textcopy/llms.txt The IClipboard interface defines the contract for clipboard operations. It is implemented by Clipboard and MockClipboard, allowing for dependency injection and testing. ```APIDOC ## `IClipboard` — Interface for dependency injection and testing `IClipboard` is the interface implemented by both `Clipboard` and `MockClipboard`. Depending on this interface rather than the concrete class allows components to be easily unit-tested by swapping in a mock, and enables framework-level injection via `IServiceCollection`. ```csharp using TextCopy; using Microsoft.Extensions.DependencyInjection; // --- Production setup --- var services = new ServiceCollection(); services.InjectClipboard(); // registers Clipboard as IClipboard singleton var provider = services.BuildServiceProvider(); IClipboard clipboard = provider.GetRequiredService(); clipboard.SetText("Injected clipboard write"); Console.WriteLine(await clipboard.GetTextAsync()); // Output: Injected clipboard write // --- Consumer component --- public class MyFeature { readonly IClipboard _clipboard; public MyFeature(IClipboard clipboard) => _clipboard = clipboard; public async Task CopyReport(string report) { await _clipboard.SetTextAsync(report); Console.WriteLine("Report copied to clipboard."); } public async Task PasteReport() => await _clipboard.GetTextAsync(); } ``` ``` -------------------------------- ### GetText Source: https://github.com/copytext/textcopy/blob/main/readme.md Synchronously retrieves the current text content from the clipboard. ```APIDOC ## GetText ### Description Synchronously retrieves the current text content from the clipboard. ### Method `GetText` ### Endpoint N/A (SDK Method) ### Parameters None ### Request Example ```cs var text = ClipboardService.GetText(); ``` ### Response #### Success Response (string) - **text** (string) - The text currently in the clipboard. #### Response Example ```json { "example": "Retrieved text from clipboard" } ``` ``` -------------------------------- ### Write text to clipboard synchronously with ClipboardService Source: https://context7.com/copytext/textcopy/llms.txt Use `ClipboardService.SetText` for simple, synchronous text writes to the clipboard. This method clears existing content and replaces it with the provided string. Setting an empty string clears the clipboard. ```csharp using TextCopy; // Write a plain string to the clipboard ClipboardService.SetText("Hello, clipboard!"); // Overwrite with new content ClipboardService.SetText("Replaced content"); // Clear the clipboard by setting an empty string ClipboardService.SetText(""); ``` -------------------------------- ### Consume IClipboard in Blazor Component Source: https://github.com/copytext/textcopy/blob/main/readme.md Inject and use the IClipboard service within a Blazor component to copy or read text from the clipboard. Ensure the browser APIs clipboard.readText and clipboard.writeText are supported. ```csharp public partial class IndexModel : ComponentBase { [Inject] public IClipboard Clipboard { get; set; } public string Content { get; set; } public Task CopyTextToClipboard() => Clipboard.SetTextAsync(Content); public async Task ReadTextFromClipboard() => Content = await Clipboard.GetTextAsync(); } ``` -------------------------------- ### ClearClipboard Source: https://github.com/copytext/textcopy/blob/main/readme.md Clears the clipboard by setting its content to an empty string. ```APIDOC ## ClearClipboard ### Description Clears the clipboard by setting its content to an empty string. ### Method `SetText` (with empty string argument) ### Endpoint N/A (SDK Method) ### Parameters #### Request Body - **text** (string) - An empty string to clear the clipboard. ### Request Example ```cs ClipboardService.SetText(""); ``` ### Response #### Success Response None (void) #### Response Example None ``` -------------------------------- ### Write text to clipboard asynchronously with ClipboardService Source: https://context7.com/copytext/textcopy/llms.txt Employ `ClipboardService.SetTextAsync` for non-blocking asynchronous text writes, suitable for `async` methods. It supports an optional `CancellationToken` for managing operation timeouts or cancellations. An empty string clears the clipboard. ```csharp using TextCopy; // Basic async write await ClipboardService.SetTextAsync("Async clipboard content"); // With cancellation support using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2)); await ClipboardService.SetTextAsync("With cancellation token", cts.Token); // Clear the clipboard asynchronously await ClipboardService.SetTextAsync(""); ``` -------------------------------- ### Read text from clipboard asynchronously with ClipboardService Source: https://context7.com/copytext/textcopy/llms.txt Fetch clipboard text asynchronously using `ClipboardService.GetTextAsync`. This method returns a `Task` and handles `null` for empty or non-text clipboard content. Unicode characters are fully supported. ```csharp using TextCopy; await ClipboardService.SetTextAsync("Async read example"); string? text = await ClipboardService.GetTextAsync(); Console.WriteLine(text ?? "Nothing on clipboard"); // Output: Async read example // Unicode content is fully supported await ClipboardService.SetTextAsync("🅢 Unicode works too"); string? unicode = await ClipboardService.GetTextAsync(); Console.WriteLine(unicode); // Output: 🅢 Unicode works too ``` -------------------------------- ### Clear Clipboard Synchronously Source: https://github.com/copytext/textcopy/blob/main/readme.md Set the clipboard content to an empty string to clear it synchronously. Ensure the ClipboardService is accessible. ```cs ClipboardService.SetText(""); ``` -------------------------------- ### ClipboardService.GetTextAsync Source: https://context7.com/copytext/textcopy/llms.txt Asynchronously reads text from the system clipboard. Returns a Task which resolves to the clipboard's text content or null if empty/non-text. ```APIDOC ## ClipboardService.GetTextAsync — Read text from the clipboard asynchronously ### Description The static `ClipboardService.GetTextAsync` method asynchronously retrieves text from the clipboard and returns a `Task`. Returns `null` when the clipboard is empty or contains non-text data. ### Method `Task GetTextAsync(CancellationToken cancellationToken = default)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp using TextCopy; await ClipboardService.SetTextAsync("Async read example"); string? text = await ClipboardService.GetTextAsync(); Console.WriteLine(text ?? "Nothing on clipboard"); // Output: Async read example // Unicode content is fully supported await ClipboardService.SetTextAsync("🅢 Unicode works too"); string? unicode = await ClipboardService.GetTextAsync(); Console.WriteLine(unicode); // Output: 🅢 Unicode works too ``` ### Response #### Success Response (Task) Returns a Task that resolves to the text content of the clipboard, or null if the clipboard is empty or does not contain text. #### Response Example ```json "Async read example" ``` #### Null Response Example ```json null ``` ``` -------------------------------- ### Read text from clipboard synchronously with ClipboardService Source: https://context7.com/copytext/textcopy/llms.txt Retrieve current clipboard text synchronously using `ClipboardService.GetText`. Returns `null` if the clipboard is empty or contains non-text data. Ensure you handle the `null` case. ```csharp using TextCopy; ClipboardService.SetText("Sample clipboard text"); string? text = ClipboardService.GetText(); if (text is not null) { Console.WriteLine($"Clipboard contains: {text}"); // Output: Clipboard contains: Sample clipboard text } else { Console.WriteLine("Clipboard is empty or has no text."); } ``` -------------------------------- ### ClipboardService.GetText Source: https://context7.com/copytext/textcopy/llms.txt Reads the current text content from the system clipboard synchronously. Returns null if the clipboard is empty or does not contain text data. ```APIDOC ## ClipboardService.GetText — Read text from the clipboard synchronously ### Description The static `ClipboardService.GetText` method retrieves the current text content from the system clipboard synchronously, returning `null` if the clipboard is empty or does not contain text data. ### Method `string? GetText()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp using TextCopy; ClipboardService.SetText("Sample clipboard text"); string? text = ClipboardService.GetText(); if (text is not null) { Console.WriteLine($"Clipboard contains: {text}"); // Output: Clipboard contains: Sample clipboard text } else { Console.WriteLine("Clipboard is empty or has no text."); } ``` ### Response #### Success Response (string?) Returns the text content of the clipboard, or null if the clipboard is empty or does not contain text. #### Response Example ```json "Sample clipboard text" ``` #### Null Response Example ```json null ``` ``` -------------------------------- ### GetTextAsync Source: https://github.com/copytext/textcopy/blob/main/readme.md Asynchronously retrieves the current text content from the clipboard. ```APIDOC ## GetTextAsync ### Description Asynchronously retrieves the current text content from the clipboard. ### Method `GetTextAsync` ### Endpoint N/A (SDK Method) ### Parameters None ### Request Example ```cs var text = await ClipboardService.GetTextAsync(); ``` ### Response #### Success Response (string) - **text** (string) - The text currently in the clipboard. #### Response Example ```json { "example": "Retrieved text from clipboard" } ``` ``` -------------------------------- ### Inject and Use IClipboard in Blazor Component Source: https://context7.com/copytext/textcopy/llms.txt Inject `IClipboard` into your Blazor component to interact with the system clipboard. This implementation uses JSInterop for browser-based applications. ```csharp using Microsoft.AspNetCore.Components; using TextCopy; public partial class IndexModel : ComponentBase { [Inject] public IClipboard Clipboard { get; set; } public string Content { get; set; } = string.Empty; // Called from a button click: copies Content to the clipboard public Task CopyTextToClipboard() => Clipboard.SetTextAsync(Content); // Called from a button click: pastes from the clipboard into Content public async Task ReadTextFromClipboard() => Content = await Clipboard.GetTextAsync() ?? string.Empty; } ``` ```razor @* Pages/Index.razor *@ @page "/" @inherits IndexModel

Clipboard Demo


Current content: @Content

``` -------------------------------- ### ClipboardService.SetText Source: https://context7.com/copytext/textcopy/llms.txt Writes plain text to the system clipboard synchronously. This method clears any existing content and replaces it with the provided string. It's suitable for non-async contexts. ```APIDOC ## ClipboardService.SetText — Write text to the clipboard synchronously ### Description The static `ClipboardService.SetText` method clears the system clipboard and places the provided string onto it synchronously. This is the simplest entry point for non-async contexts such as console applications or synchronous event handlers. ### Method `ClipboardService.SetText(string text)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp using TextCopy; // Write a plain string to the clipboard ClipboardService.SetText("Hello, clipboard!"); // Overwrite with new content ClipboardService.SetText("Replaced content"); // Clear the clipboard by setting an empty string ClipboardService.SetText(""); ``` ### Response #### Success Response (void) This method does not return a value. #### Response Example None ``` -------------------------------- ### ClearClipboardAsync Source: https://github.com/copytext/textcopy/blob/main/readme.md Asynchronously clears the clipboard by setting its content to an empty string. ```APIDOC ## ClearClipboardAsync ### Description Asynchronously clears the clipboard by setting its content to an empty string. ### Method `SetTextAsync` (with empty string argument) ### Endpoint N/A (SDK Method) ### Parameters #### Request Body - **text** (string) - An empty string to clear the clipboard. ### Request Example ```cs await ClipboardService.SetTextAsync(""); ``` ### Response #### Success Response None (void) #### Response Example None ``` -------------------------------- ### Clear Clipboard Asynchronously Source: https://github.com/copytext/textcopy/blob/main/readme.md Set the clipboard content to an empty string to clear it asynchronously. Ensure the ClipboardService is accessible. ```cs await ClipboardService.SetTextAsync(""); ``` -------------------------------- ### SetText Source: https://github.com/copytext/textcopy/blob/main/readme.md Synchronously sets the text content of the clipboard. ```APIDOC ## SetText ### Description Synchronously sets the text content of the clipboard. ### Method `SetText` ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **text** (string) - The text to be placed in the clipboard. ### Request Example ```cs ClipboardService.SetText("Text to place in clipboard"); ``` ### Response #### Success Response None (void) #### Response Example None ``` -------------------------------- ### ClipboardService.SetTextAsync Source: https://context7.com/copytext/textcopy/llms.txt Asynchronously writes plain text to the system clipboard. It supports cancellation via a CancellationToken and is ideal for use within async methods to prevent blocking. ```APIDOC ## ClipboardService.SetTextAsync — Write text to the clipboard asynchronously ### Description The static `ClipboardService.SetTextAsync` method is the async counterpart to `SetText`. It accepts an optional `CancellationToken` and is appropriate for use inside `async` methods to avoid blocking the calling thread. ### Method `Task SetTextAsync(string text, CancellationToken cancellationToken = default)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp using TextCopy; // Basic async write await ClipboardService.SetTextAsync("Async clipboard content"); // With cancellation support using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2)); await ClipboardService.SetTextAsync("With cancellation token", cts.Token); // Clear the clipboard asynchronously await ClipboardService.SetTextAsync(""); ``` ### Response #### Success Response (Task) This method returns a Task that completes when the operation is finished. #### Response Example None ``` -------------------------------- ### SetTextAsync Source: https://github.com/copytext/textcopy/blob/main/readme.md Asynchronously sets the text content of the clipboard. ```APIDOC ## SetTextAsync ### Description Asynchronously sets the text content of the clipboard. ### Method `SetTextAsync` ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **text** (string) - The text to be placed in the clipboard. ### Request Example ```cs await ClipboardService.SetTextAsync("Text to place in clipboard"); ``` ### Response #### Success Response None (void) #### Response Example None ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.