public void SelectedWebsiteImage(MagickImage image, ShortcutControl control) { image.Format = MagickFormat.Ico; string filePath = IconManager.SaveIcon(image, control.Shortcut.Name); control.IconSelectedEvent(filePath); }
private static ShortcutControl AddShortcut(Shortcut shortcut, int insertIndex) { ShortcutControl newControl = new ShortcutControl(); newControl.Shortcut = shortcut; if (shortcut.Actions == null) { shortcut.Actions = new List <Action>(); } if (shortcut.Actions.Count != 1) { newControl.ShortcutType = Structures.ShortcutType.Multi; newControl.CreateGroupActions(shortcut.Actions); } else { newControl.ShortcutType = shortcut.Actions[0].ToShortcutType(); } Wind.ShortcutListArea_ShortcutsParent.Children.Insert(insertIndex, newControl); Shortcuts.Insert(insertIndex, newControl); newControl.UpdateUi(); return(newControl); }
public static void AddShortcut(object sender, RoutedEventArgs args) { ShortcutControl newControl = new ShortcutControl(); Wind.ShortcutListArea_ShortcutsParent.Children.Add(newControl); Shortcuts.Add(newControl); }
private static void RemoveShortcutYes(bool isYes, ShortcutControl control) { if (isYes) { Shortcuts.Remove(control); Wind.ShortcutListArea_ShortcutsParent.Children.Remove(control); } }
public static void RemoveShortcut(ShortcutControl control) { if (Wind.Settings.YesNoDialogsEnabled) { Dialogs.YesNoDialog.SetMessage("Are you sure?", $"Do you want to remove the shortcut \"{control.Shortcut.Name}\"?", "Yes", "No", (isYes) => RemoveShortcutYes(isYes, control)); DialogManager.Show(Structures.DialogTypes.YesNoDialog); } else { RemoveShortcutYes(true, control); } }
public static void MoveDownShortcut(ShortcutControl control) { int oldIndex = Shortcuts.IndexOf(control); if (oldIndex < Shortcuts.Count - 1) { Shortcuts.Remove(control); Wind.ShortcutListArea_ShortcutsParent.Children.Remove(control); Shortcuts.Insert(oldIndex + 1, control); Wind.ShortcutListArea_ShortcutsParent.Children.Insert(oldIndex + 1, control); } }
public static void MoveUpShortcut(ShortcutControl control) { int oldIndex = Shortcuts.IndexOf(control); if (oldIndex > 0) { Shortcuts.Remove(control); Wind.ShortcutListArea_ShortcutsParent.Children.Remove(control); Shortcuts.Insert(oldIndex - 1, control); Wind.ShortcutListArea_ShortcutsParent.Children.Insert(oldIndex - 1, control); } }
public static void CreateOrFocusInstance(MainWindow window, ShortcutControl control) { if (CurrentWindow != null) { if (ContainsWindow(Application.Current.Windows, CurrentWindow)) { CurrentWindow.Focus(); return; } } CurrentWindow = new IconExtractorWindow(window, control); CurrentWindow.Show(); }
public IconExtractorWindow(MainWindow mainWindow, ShortcutControl control) { window = mainWindow; shortcutControl = control; InitializeComponent(); IconExtractorWindow_TitleBarControl.InitEvents(this); Loaded += (s, e) => { Closing += OnWindowClose; }; }
public SubShortcutControl(ShortcutControl parentControl) { parent = parentControl; InitializeComponent(); InitControl(ShortcutType.Web); }
public static void DuplicateShortcut(ShortcutControl control) { int insertIndex = Shortcuts.IndexOf(control) + 1; Shortcut newShortcut = control.Shortcut.Duplicate(); ShortcutControl newControl = AddShortcut(newShortcut, insertIndex); }