using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Windows.Input; namespace AIStudio.Wpf.DiagramDesigner { public class DiagramOption { public LayoutOption LayoutOption { get; set; } = new LayoutOption(); public ShortcutOption ShortcutOption { get; set; } = new ShortcutOption(); public SnappingOption SnappingOption { get; set; } = new SnappingOption(); } public class LayoutOption { } public class SnappingOption { public bool EnableSnapping { get; set; } public double SnappingRadius { get; set; } = 50; public double HittingRadius { get; set; } = 20; } public class ShortcutOption { [Description("Select All shortcut (CTRL+A by default)")] public Func SelectAll { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.A; [Description("Copy shortcut (CTRL+C by default)")] public Func Copy { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.C; [Description("Paste shortcut (CTRL+V by default)")] public Func Paste { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.V; [Description("Cut shortcut (CTRL+X by default)")] public Func Cut { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.X; [Description("Undo shortcut (CTRL+Z by default)")] public Func Undo { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.Z; [Description("Undo shortcut (CTRL+Y by default)")] public Func Redo { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.Y; [Description("Delete shortcut (Delete by default)")] public Func Delete { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Delete; [Description("Left Move shortcut (Left by default)")] public Func LeftMove { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Left; [Description("Right Move shortcut (Right by default)")] public Func RightMove { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Right; [Description("Up Move shortcut (Up by default)")] public Func UpMove { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Up; [Description("Down Move shortcut (Down by default)")] public Func DownMove { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Down; [Description("Group Keyboard shortcut (CTRL+G by default)")] public Func Group { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.G; [Description("Ungroup Keyboard shortcut (Shift+G by default)")] public Func Ungroup { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Shift | e.Key == Key.G; [Description("Search shortcut (CTRL+F by default)")] public Func Search { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Control | e.Key == Key.F; [Description("Search Down shortcut (F3 by default)")] public Func SearchDown { get; set; } = e => e.Key == Key.F3; [Description("Search Up shortcut (Shift+F3 by default)")] public Func SearchUp { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Shift | e.Key == Key.F3; [Description("Replace shortcut (Alt+R by default)")] public Func Replace { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Alt | e.Key == Key.R; [Description("Replace All shortcut (Alt+A by default)")] public Func ReplaceAll { get; set; } = e => e.KeyboardDevice.Modifiers == ModifierKeys.Alt | e.Key == Key.A; } }