forked from thedeemon/gep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenerateCodeForm.cs
39 lines (34 loc) · 1004 Bytes
/
GenerateCodeForm.cs
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
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace gep
{
partial class GenerateCodeForm : Form
{
string Code;
public GenerateCodeForm(string code)
{
Code = code;
InitializeComponent();
}
private void GenerateCodeForm_Load(object sender, EventArgs e)
{
using (var ff = new FontFamily(System.Drawing.Text.GenericFontFamilies.Monospace))
{
textBox.Font = new Font(ff, 10, FontStyle.Regular);
textBox.Text = Code;
}
}
private void OnFormClosed(object sender, FormClosedEventArgs e)
{
var result = saveFileDialog.ShowDialog();
var file = saveFileDialog.FileName;
File.WriteAllText(file, textBox.Text);
}
}
}