/// <summary> /// Updates the keys. This is similar to RebuildListOfKeys but is called on Application /// load to handle modification of the keys. /// /// THIS Will override any TEMPORARY modifications made by RebuildListOfKeys (as long as it is called when the form is closed) /// </summary> public void UpdateKeys(List <KeyData> HotKeys, string DatabaseName) { List <KeyData> ModifiedKeys = GetListOfModifiedKeys(DatabaseName); foreach (KeyData keysy in HotKeys) { KeyData keyModified = ModifiedKeys.Find(KeyData => KeyData.GetGUID() == keysy.GetGUID()); if (keyModified != null) { // we have an overriden key keysy.Key = keyModified.Key; keysy.ModifyingKey = keyModified.ModifyingKey; } } }
private void RebuildListOfKeys() { configPanel.Controls.Clear(); HotKeys.Sort(); List <KeyData> ModifiedKeys = GetListOfModifiedKeys(DatabaseName); //NewMessage.Show (HotKeys.Count.ToString()); foreach (KeyData keysy in HotKeys) { KeyData keyModified = ModifiedKeys.Find(KeyData => KeyData.GetGUID() == keysy.GetGUID()); if (keyModified != null) { // we have an overriden key keysy.Key = keyModified.Key; keysy.ModifyingKey = keyModified.ModifyingKey; } VisualKey keyPanel = new VisualKey(keysy, MainFormBase.MainFormIcon, AfterKeyEdit); // apply any overrides from database storage configPanel.Controls.Add(keyPanel); keyPanel.Dock = DockStyle.Top; } Button Reset = new Button(); Reset.Text = Loc.Instance.GetString("Reset"); Reset.Dock = DockStyle.Top; Reset.Click += HandleResetClick; configPanel.Controls.Add(Reset); Reset.BringToFront(); CheckForErrors(); }