Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading;
- using System.Windows.Forms;
- namespace dIRC7
- {
- public class IRCClipBoard
- {
- string Data;
- public void AddDataToClipboard(string Text)
- {
- if (String.IsNullOrEmpty(Text))
- {
- return;
- }
- Data = Text;
- Thread ClipboardThread = new Thread(_ClipboardWaiter);
- ClipboardThread.Start();
- }
- private void _ClipboardWaiter()
- {
- bool bSuccess = false;
- while (!bSuccess)
- {
- // load clipboard data untill it actually loads.
- try
- {
- Clipboard.SetText(Data);
- bSuccess = true;
- break;
- }
- catch
- {
- Thread.Sleep(500);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement