-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainDisassemblerView.cs
More file actions
55 lines (46 loc) · 1.52 KB
/
Copy pathMainDisassemblerView.cs
File metadata and controls
55 lines (46 loc) · 1.52 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
53
54
55
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Z80Decompiler
{
public partial class MainDisassemblerView : Form
{
private ProjectFile projectFile;
public MainDisassemblerView()
{
InitializeComponent();
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
openFileDialog.Filter = "binary files (*.bin)|*.bin|All files (*.*)|*.*";
openFileDialog.FilterIndex = 2;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
// Create a new project file
projectFile = new ProjectFile();
try
{
// Try and process the file
projectFile.Load(openFileDialog.FileName);
}
catch (System.Exception ex)
{
Console.WriteLine("Failed to open and process the file: {0}", ex.ToString());
}
}
// Clear the text
disassemblerView.Text = null;
// Now we need to add all the new decoded lines in
}
}
}