AddonHelper.Addon.SetClipboardText C# (CSharp) Метод

SetClipboardText() публичный Метод

Safely sets the clipboard text. Refrain from using Clipboard.SetText directly, instead, use this function!
public SetClipboardText ( string Text ) : void
Text string The text to set the clipboard to
Результат void
        public void SetClipboardText(string Text)
        {
            int timeout = 5;
            while (timeout-- > 0) {
                IntPtr cbTry = GetOpenClipboardWindow();
                if (cbTry == IntPtr.Zero) break;
                System.Threading.Thread.Sleep(100);
            }
            try {
                Clipboard.SetText(Text);
            } catch (Exception ex) {
                this.Debug("Clipboard.SetText threw " + ex.GetType().FullName + ": '" + ex.Message + "'");
            }
        }