Beispiel #1
0
        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);
 }
Beispiel #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);
            }
        }
Beispiel #5
0
 public void Update(IWarKeyModel model)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 public void Save(string name, IWarKeyModel model)
 {
     this.model = model;
     repository.Update(name, model);
 }