-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMainForm.cs
More file actions
52 lines (45 loc) · 1.68 KB
/
MainForm.cs
File metadata and controls
52 lines (45 loc) · 1.68 KB
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
using System;
using System.Windows.Forms;
namespace CreatureScriptsParser
{
public partial class MainForm : Form
{
private Creator creator;
private Parsers parsers;
public MainForm()
{
InitializeComponent();
}
private void toolStripButton_ImportSniff_Click(object sender, EventArgs e)
{
OpenFileDialog();
}
private void OpenFileDialog()
{
openFileDialog.Title = "Open File";
openFileDialog.Filter = "Parsed Sniff or Data File (*.txt;*.dat)|*.txt;*.dat";
openFileDialog.FilterIndex = 1;
openFileDialog.ShowReadOnly = false;
openFileDialog.Multiselect = false;
openFileDialog.CheckFileExists = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
parsers = new Parsers(this);
DB2.Db2.Load();
if (openFileDialog.FileName.Contains("txt"))
{
creator = new Creator(this, parsers.GetPacketsFromSniffFile(openFileDialog.FileName, checkBox_CreateDataFile.Checked));
}
else if (openFileDialog.FileName.Contains("dat"))
{
creator = new Creator(this, parsers.GetPacketsFromDataFile(openFileDialog.FileName));
}
toolStripStatusLabel_FileStatus.Text = openFileDialog.FileName + " is selected for input.";
}
}
private void toolStripButton_Search_Click(object sender, EventArgs e)
{
creator.CreateScriptsForCreatureWithGuid(toolStripTextBox_CreatureGuid.Text);
}
}
}