Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Clipboard.cs
Go to the documentation of this file.
1using System;
4
5namespace ReLogic.OS.OSX;
6
7internal class Clipboard : ReLogic.OS.Base.Clipboard
8{
9 protected override string GetClipboard()
10 {
11 try
12 {
13 string result;
14 using (Process process = new Process())
15 {
16 process.StartInfo = new ProcessStartInfo("pbpaste", "-pboard general")
17 {
18 UseShellExecute = false,
19 RedirectStandardOutput = true
20 };
21 process.Start();
22 result = process.StandardOutput.ReadToEnd();
23 process.WaitForExit();
24 }
25 return result;
26 }
27 catch (Exception)
28 {
29 return "";
30 }
31 }
32
33 protected override void SetClipboard(string text)
34 {
35 try
36 {
37 using Process process = new Process();
38 process.StartInfo = new ProcessStartInfo("pbcopy", "-pboard general -Prefer txt")
39 {
40 UseShellExecute = false,
41 RedirectStandardOutput = false,
42 RedirectStandardInput = true
43 };
44 process.Start();
45 process.StandardInput.Write(text);
46 process.StandardInput.Close();
47 process.WaitForExit();
48 }
49 catch (Exception)
50 {
51 }
52 }
53}
override string GetClipboard()
Definition Clipboard.cs:9
override void SetClipboard(string text)
Definition Clipboard.cs:33
StreamReader StandardOutput
Definition Process.cs:673