forked from florentbr/SeleniumBasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClipboardExt.cs
More file actions
32 lines (25 loc) · 762 Bytes
/
ClipboardExt.cs
File metadata and controls
32 lines (25 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Drawing;
using System.Windows.Forms;
namespace Selenium.Internal {
class ClipboardExt {
public static void SetText(string value) {
ThreadExt.RunSTA(() => {
Clipboard.SetText(value, TextDataFormat.UnicodeText);
return 0;
}, 6000);
}
public static void SetImage(Bitmap value) {
ThreadExt.RunSTA(() => {
Clipboard.SetImage(value);
return 0;
}, 6000);
}
public static string GetText() {
string result = ThreadExt.RunSTA(() => {
string text = Clipboard.GetText();
return text;
}, 6000);
return result;
}
}
}