1 |
william |
857 |
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.RVACheatList |
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.Icon = Core.Properties.Resources.romcheater_icon; |
23 |
|
|
this.CheatName = string.Empty; |
24 |
|
|
this.CheatAddress = 0; |
25 |
|
|
} |
26 |
|
|
public CheatInputDialog(string cheatname, uint cheataddress) : this() |
27 |
|
|
{ |
28 |
|
|
this.CheatName = cheatname; |
29 |
|
|
this.CheatAddress = cheataddress; |
30 |
|
|
} |
31 |
|
|
#region ICheatInputDialog Members |
32 |
|
|
public string CheatName { get; private set; } |
33 |
|
|
public uint CheatAddress { get; private set; } |
34 |
|
|
#endregion |
35 |
|
|
|
36 |
|
|
private void CheatInputDialog_Shown(object sender, EventArgs e) |
37 |
|
|
{ |
38 |
|
|
txtCheatName.Text = this.CheatName; |
39 |
|
|
txtCheatAddress.Value = this.CheatAddress; |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
private void btnOK_Click(object sender, EventArgs e) |
43 |
|
|
{ |
44 |
|
|
this.CheatName = txtCheatName.Text; |
45 |
|
|
this.CheatAddress = txtCheatAddress.ToUInt32(); |
46 |
|
|
this.DialogResult = DialogResult.OK; |
47 |
|
|
this.Close(); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
private void btnCANCEL_Click(object sender, EventArgs e) |
51 |
|
|
{ |
52 |
|
|
this.DialogResult = DialogResult.Cancel; |
53 |
|
|
this.Close(); |
54 |
|
|
} |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
|
58 |
|
|
} |