2024-05-04 10:47:42 +02:00
|
|
|
// ReSharper disable ClassNeverInstantiated.Global
|
|
|
|
|
|
2024-08-21 08:30:01 +02:00
|
|
|
namespace AIStudio.Tools.Services;
|
2024-05-04 10:47:42 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2024-08-21 08:30:01 +02:00
|
|
|
/// Wire up the clipboard service to copy Markdown to the clipboard.
|
2024-05-04 10:47:42 +02:00
|
|
|
/// We use our own Rust-based clipboard service for this.
|
|
|
|
|
/// </summary>
|
2026-08-02 21:41:12 +02:00
|
|
|
public sealed class MarkdownClipboardService(RustService rust) : IMudMarkdownClipboardService
|
2024-05-04 10:47:42 +02:00
|
|
|
{
|
2024-09-01 20:10:03 +02:00
|
|
|
private RustService Rust { get; } = rust;
|
2024-05-04 10:47:42 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2024-09-01 20:10:03 +02:00
|
|
|
/// Gets called when the user wants to copy the Markdown to the clipboard.
|
2024-05-04 10:47:42 +02:00
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The Markdown text to copy.</param>
|
2026-08-02 21:41:12 +02:00
|
|
|
public async ValueTask CopyToClipboardAsync(string text) => await this.Rust.CopyText2Clipboard(text);
|
2024-05-04 10:47:42 +02:00
|
|
|
}
|