Esempio n. 1
0
 private void RemoveSubShortcutYes(bool isYes, SubShortcutControl control)
 {
     if (isYes)
     {
         SubShorcuts.Remove(control);
         MultiUi_ShortcutsParent.Children.Remove(control);
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void DeleteChild(SubShortcutControl control)
 {
     if (WindowRef.Wind.Settings.YesNoDialogsEnabled)
     {
         Dialogs.YesNoDialog.SetMessage("Are you sure?", $"Do you want to remove the action?", "Yes", "No", (isYes) => RemoveSubShortcutYes(isYes, control));
         DialogManager.Show(Structures.DialogTypes.YesNoDialog);
     }
     else
     {
         RemoveSubShortcutYes(true, control);
     }
 }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 6
0
        // 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);
        }
Esempio n. 7
0
 public void DuplicateChild(SubShortcutControl control)
 {
     int                insertIndex = SubShorcuts.IndexOf(control) + 1;
     Shortcut           newShortcut = control.Shortcut.Duplicate();
     SubShortcutControl newControl  = CreateSubShorcut(newShortcut.Actions[0], insertIndex);
 }