-
Notifications
You must be signed in to change notification settings - Fork 0
/
DebugSpewWindow.cs
61 lines (55 loc) · 1.67 KB
/
DebugSpewWindow.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using LiveSplit.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LiveSplit.DebugSpew
{
public partial class DebugSpewWindow : Form
{
public DebugSpewWindow(LiveSplitState state)
{
InitializeComponent();
bool onTop = state.LayoutSettings == null ? false : state.LayoutSettings.AlwaysOnTop;
TopMost = onTop;
chkOnTop.Checked = onTop;
AutoScroll = true;
chkAutoScroll.Checked = true;
}
private void butClear_Click(object sender, EventArgs e)
{
boxDebugSpew.Clear();
}
private void butExport_Click(object sender, EventArgs e)
{
string[] dump = new string[] { boxDebugSpew.Text };
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "Log Files (*.log)|*.log";
if (dialog.ShowDialog() == DialogResult.OK)
{
File.WriteAllLines(dialog.FileName, dump);
}
else return;
}
private void DoClosing(object sender, FormClosingEventArgs e)
{
this.Hide();
e.Cancel = true;
}
private void chkOnTop_CheckedChanged(object sender, EventArgs e)
{
this.TopMost = chkOnTop.Checked;
}
private void chkAutoScroll_CheckedChanged(object sender, EventArgs e)
{
AutoScroll = chkAutoScroll.Checked;
}
}
}