private void RemoveSubShortcutYes(bool isYes, SubShortcutControl control) { if (isYes) { SubShorcuts.Remove(control); MultiUi_ShortcutsParent.Children.Remove(control); } }
private SubShortcutControl CreateSubShorcut(Core.DataStructures.Action action, int index) { SubShortcutControl newControl = new SubShortcutControl(this); newControl.Shortcut.Actions[0] = action; newControl.ShortcutType = action.ToShortcutType(); MultiUi_ShortcutsParent.Children.Insert(index, newControl); SubShorcuts.Insert(index, newControl); newControl.UpdateUi(); return(newControl); }
public void MoveDownChild(SubShortcutControl control) { int oldIndex = SubShorcuts.IndexOf(control); if (oldIndex < SubShorcuts.Count - 1) { SubShorcuts.Remove(control); MultiUi_ShortcutsParent.Children.Remove(control); SubShorcuts.Insert(oldIndex + 1, control); MultiUi_ShortcutsParent.Children.Insert(oldIndex + 1, control); } }
public void MoveUpChild(SubShortcutControl control) { int oldIndex = SubShorcuts.IndexOf(control); if (oldIndex > 0) { SubShorcuts.Remove(control); MultiUi_ShortcutsParent.Children.Remove(control); SubShorcuts.Insert(oldIndex - 1, control); MultiUi_ShortcutsParent.Children.Insert(oldIndex - 1, control); } }
// Multi shortcut changed events private void MultiUi_AddShorcutButtonPressed(object sender, RoutedEventArgs e) { if (SubShorcuts == null) { SubShorcuts = new List <SubShortcutControl>(); } SubShortcutControl newControl = new SubShortcutControl(this); MultiUi_ShortcutsParent.Children.Add(newControl); SubShorcuts.Add(newControl); }
public void DuplicateChild(SubShortcutControl control) { int insertIndex = SubShorcuts.IndexOf(control) + 1; Shortcut newShortcut = control.Shortcut.Duplicate(); SubShortcutControl newControl = CreateSubShorcut(newShortcut.Actions[0], insertIndex); }