public WarKeyController(IWarKeyView view) { this.view = view; this.model = view.GetCurrent(); this.repository = new WarKeyModelRepository(); keyboard = new Keyboard(this); }
public void Create(string name, IWarKeyModel model) { BinaryFormatter formatter = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); formatter.Serialize(stream, model); RegistryKey hklm = Registry.LocalMachine; RegistryKey hkSoftware = hklm.OpenSubKey("Software", true); RegistryKey hkWarKey = hkSoftware.CreateSubKey("WarKey"); hkWarKey.SetValue(name, stream.ToArray()); hkWarKey.Close(); }
public void Update(string name, IWarKeyModel model) { Create(name, model); }
private void UpdateUI(IWarKeyModel model) { this.cbDisplayEnemysHP.Checked = model.DisplayEnemysHP; this.cbDisplayAlliesHP.Checked = model.DisplayAlliesHP; foreach (KeyValuePair<int, int> pair in model.KeyMappers) { this.UpdateTextBox(pair); } }
public void Update(IWarKeyModel model) { throw new NotImplementedException(); }
public void Save(string name, IWarKeyModel model) { this.model = model; repository.Update(name, model); }