using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace RomCheater.RVACheatList { public interface ICheatInputDialog { string CheatName { get; } uint CheatAddress { get; } } public partial class CheatInputDialog : Form, ICheatInputDialog { public CheatInputDialog() { InitializeComponent(); this.CheatName = string.Empty; this.CheatAddress = 0; } public CheatInputDialog(string cheatname, uint cheataddress) : this() { this.CheatName = cheatname; this.CheatAddress = cheataddress; } #region ICheatInputDialog Members public string CheatName { get; private set; } public uint CheatAddress { get; private set; } #endregion private void CheatInputDialog_Shown(object sender, EventArgs e) { txtCheatName.Text = this.CheatName; txtCheatAddress.Value = this.CheatAddress; } private void btnOK_Click(object sender, EventArgs e) { this.CheatName = txtCheatName.Text; this.CheatAddress = txtCheatAddress.ToUInt32(); this.DialogResult = DialogResult.OK; this.Close(); } private void btnCANCEL_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } } }