/// <summary>
        /// Tries to get text contents from the Windows clipboard. If the clipboard contains any other type then text, the returned result will be <c>false</c>.
        /// </summary>
        /// <returns><c>true</c> if text could be retrieved.</returns>
        public bool GetClipboardText(out string text)
        {
            string           result        = null;
            ManualResetEvent finishedEvent = new ManualResetEvent(false);
            Thread           thread        = ThreadingUtils.RunSTAThreaded(() => GetClipboardText_STA(finishedEvent, ref result));

            if (!finishedEvent.WaitOne(MAX_WAIT_MS))
            {
                thread.Abort();
            }

            finishedEvent.Close();
            text = result;
            return(!string.IsNullOrWhiteSpace(result));
        }
        /// <summary>
        /// Tries to set text contents into Windows clipboard.
        /// </summary>
        /// <param name="text">Text to copy.</param>
        /// <returns><c>true</c> if text was set.</returns>
        public bool SetClipboardText(string text)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                return(false);
            }

            ManualResetEvent finishedEvent = new ManualResetEvent(false);
            Thread           thread        = ThreadingUtils.RunSTAThreaded(() => SetClipboardText_STA(finishedEvent, text));

            if (!finishedEvent.WaitOne(MAX_WAIT_MS))
            {
                thread.Abort();
            }

            finishedEvent.Close();
            return(true);
        }