1 |
using System; |
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Data; |
5 |
using System.Drawing; |
6 |
using System.Linq; |
7 |
using System.Text; |
8 |
using System.Windows.Forms; |
9 |
|
10 |
namespace RomCheater.RVACalculator |
11 |
{ |
12 |
public interface ICheatInputDialog |
13 |
{ |
14 |
string CheatName { get; } |
15 |
uint CheatAddress { get; } |
16 |
} |
17 |
public partial class CheatInputDialog : Form, ICheatInputDialog |
18 |
{ |
19 |
public CheatInputDialog() |
20 |
{ |
21 |
InitializeComponent(); |
22 |
this.CheatName = string.Empty; |
23 |
this.CheatAddress = 0; |
24 |
} |
25 |
public CheatInputDialog(string cheatname, uint cheataddress) : this() |
26 |
{ |
27 |
this.CheatName = cheatname; |
28 |
this.CheatAddress = cheataddress; |
29 |
} |
30 |
#region ICheatInputDialog Members |
31 |
public string CheatName { get; private set; } |
32 |
public uint CheatAddress { get; private set; } |
33 |
#endregion |
34 |
|
35 |
private void CheatInputDialog_Shown(object sender, EventArgs e) |
36 |
{ |
37 |
txtCheatName.Text = this.CheatName; |
38 |
txtCheatAddress.Value = this.CheatAddress; |
39 |
} |
40 |
|
41 |
private void btnOK_Click(object sender, EventArgs e) |
42 |
{ |
43 |
this.CheatName = txtCheatName.Text; |
44 |
this.CheatAddress = txtCheatAddress.ToUInt32(); |
45 |
this.DialogResult = DialogResult.OK; |
46 |
this.Close(); |
47 |
} |
48 |
|
49 |
private void btnCANCEL_Click(object sender, EventArgs e) |
50 |
{ |
51 |
this.DialogResult = DialogResult.Cancel; |
52 |
this.Close(); |
53 |
} |
54 |
} |
55 |
|
56 |
|
57 |
} |