diff --git a/Windows.Shell.Common/NativeClipboard.cs b/Windows.Shell.Common/NativeClipboard.cs index da5f09abc..57941b283 100644 --- a/Windows.Shell.Common/NativeClipboard.cs +++ b/Windows.Shell.Common/NativeClipboard.cs @@ -536,12 +536,12 @@ public static void SetShellItems(ShellFolder parent, IEnumerable rela /// The Unicode Text value. /// The HTML text value. If , this format will not be set. /// The Rich Text Format value. If , this format will not be set. - public static void SetText(string text, string htmlText = null, string rtfText = null) + public static void SetText(string text, string htmlText = null, string rtfText = null) => Setter(ido => { - if (text is not null) SetText(text, TextDataFormat.UnicodeText); - if (htmlText is not null) SetText(htmlText, TextDataFormat.Html); - if (rtfText is not null) SetText(rtfText, TextDataFormat.Rtf); - } + if (text is not null) ido.SetData(CLIPFORMAT.CF_UNICODETEXT, text); + if (htmlText is not null) ido.SetData(ShellClipboardFormat.CF_HTML, htmlText); + if (rtfText is not null) ido.SetData(ShellClipboardFormat.CF_RTF, rtfText); + }); /// Sets a specific text type to the Clipboard. /// The text value.