Example #1
0
        public WarKeyController(IWarKeyView view)
        {
            this.view = view;
            this.model = view.GetCurrent();
            this.repository = new WarKeyModelRepository();

            keyboard = new Keyboard(this);
        }
Example #2
0
        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();
        }
Example #3
0
 public void Update(string name, IWarKeyModel model)
 {
     Create(name, model);
 }
Example #4
0
        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);
            }
        }
Example #5
0
 public void Update(IWarKeyModel model)
 {
     throw new NotImplementedException();
 }
Example #6
0
 public void Save(string name, IWarKeyModel model)
 {
     this.model = model;
     repository.Update(name, model);
 }