forked from Michal-MK/TurtleGraphics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (24 loc) · 741 Bytes
/
Copy pathProgram.cs
File metadata and controls
28 lines (24 loc) · 741 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
using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace TurtleGraphicsCode {
/// <summary>
/// This is a private space, you do not need to be here ;)
/// </summary>
class Program {
public static void Main() {
Launch(new Code().ToExecute());
}
public static void Launch(Turtle turtle) {
BinaryFormatter bf = new BinaryFormatter();
using (FileStream fs = File.OpenWrite("data.tgc")) {
bf.Serialize(fs, turtle.Data);
}
ProcessStartInfo info = new ProcessStartInfo("TurtleGraphics.exe", (turtle.FullScreen ? "-f " : "") + "data.tgc");
using (Process p = new Process() { StartInfo = info }) {
p.EnableRaisingEvents = true;
p.Start();
}
}
}
}