public void RemoveBinding(CommandKeyBinding binding) { if (binding == null) { return; } binding.SetParentFolder(null); _CommandBindings.Remove(binding); }
public void AddBinding(CommandKeyBinding binding) { if (binding == null) { return; } binding.SetParentFolder(this); _CommandBindings.Add(binding); }
/// <summary> /// Loads the command key bindings from storage. /// </summary> /// <param name="aDecoupledStorage"></param> /// <returns>Returns the most recently selected command key binding.</returns> public CommandKeyBinding Load(DecoupledStorage aDecoupledStorage, CommandKeyFolder parentFolder) { Clear(); CommandKeyBinding lLastSelected = null; CommandKeyBinding lCommandKeyBinding = null; int thisCount = aDecoupledStorage.ReadInt32("Header", "Count", Count); for (int i = 0; i < thisCount; i++) { lCommandKeyBinding = new CommandKeyBinding(); lCommandKeyBinding.SetParentFolder(parentFolder); if (lCommandKeyBinding.Load(aDecoupledStorage, "Command" + i.ToString())) { lLastSelected = lCommandKeyBinding; } Add(lCommandKeyBinding); } return(lLastSelected); }