Files
aistudio-wpf-diagram/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramOption.cs

138 lines
4.5 KiB
C#
Raw Normal View History

2023-02-04 20:21:18 +08:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Windows.Input;
namespace AIStudio.Wpf.DiagramDesigner
{
public class DiagramOption
{
2023-02-12 21:30:16 +08:00
public LayoutOption LayoutOption
{
get; set;
} = new LayoutOption();
2023-02-04 20:21:18 +08:00
public ShortcutOption ShortcutOption
{
get; set;
} = new ShortcutOption();
}
2023-02-12 21:30:16 +08:00
public class LayoutOption
{
}
2023-02-04 20:21:18 +08:00
public class ShortcutOption
{
[Description("Select All shortcut (CTRL+A by default)")]
public Func<KeyEventArgs, bool> SelectAll
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.A;
[Description("Copy shortcut (CTRL+C by default)")]
public Func<KeyEventArgs, bool> Copy
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.C;
[Description("Paste shortcut (CTRL+V by default)")]
public Func<KeyEventArgs, bool> Paste
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.V;
[Description("Cut shortcut (CTRL+X by default)")]
public Func<KeyEventArgs, bool> Cut
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.X;
[Description("Undo shortcut (CTRL+Z by default)")]
public Func<KeyEventArgs, bool> Undo
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.Z;
[Description("Undo shortcut (CTRL+Y by default)")]
public Func<KeyEventArgs, bool> Redo
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.Y;
[Description("Delete shortcut (Delete by default)")]
public Func<KeyEventArgs, bool> Delete
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Delete;
[Description("Left Move shortcut (Left by default)")]
public Func<KeyEventArgs, bool> LeftMove
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Left;
[Description("Right Move shortcut (Right by default)")]
public Func<KeyEventArgs, bool> RightMove
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Right;
[Description("Up Move shortcut (Up by default)")]
public Func<KeyEventArgs, bool> UpMove
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Up;
[Description("Down Move shortcut (Down by default)")]
public Func<KeyEventArgs, bool> DownMove
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Down;
2023-04-08 21:48:43 +08:00
[Description("Group Keyboard shortcut (CTRL+G by default)")]
2023-02-04 20:21:18 +08:00
public Func<KeyEventArgs, bool> Group
{
get; set;
2023-02-10 18:49:02 +08:00
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.G;
2023-02-04 20:21:18 +08:00
2023-04-08 21:48:43 +08:00
[Description("Ungroup Keyboard shortcut (Shift+G by default)")]
public Func<KeyEventArgs, bool> Ungroup
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Shift | e.Key == Key.G;
2023-04-15 21:55:27 +08:00
[Description("Search shortcut (CTRL+F by default)")]
public Func<KeyEventArgs, bool> Search
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control | e.Key == Key.F;
[Description("Search Down shortcut (F3 by default)")]
public Func<KeyEventArgs, bool> SearchDown
{
get; set;
} = e => e.Key == Key.F3;
[Description("Search Up shortcut (Shift+F3 by default)")]
public Func<KeyEventArgs, bool> SearchUp
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Shift | e.Key == Key.F3;
[Description("Replace shortcut (Alt+R by default)")]
public Func<KeyEventArgs, bool> Replace
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Alt | e.Key == Key.R;
[Description("Replace All shortcut (Alt+A by default)")]
public Func<KeyEventArgs, bool> ReplaceAll
{
get; set;
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Alt | e.Key == Key.A;
2023-02-04 20:21:18 +08:00
}
}