public void SelectedWebsiteImage(MagickImage image, ShortcutControl control)
        {
            image.Format = MagickFormat.Ico;
            string filePath = IconManager.SaveIcon(image, control.Shortcut.Name);

            control.IconSelectedEvent(filePath);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public static void AddShortcut(object sender, RoutedEventArgs args)
        {
            ShortcutControl newControl = new ShortcutControl();

            Wind.ShortcutListArea_ShortcutsParent.Children.Add(newControl);
            Shortcuts.Add(newControl);
        }
Beispiel #4
0
 private static void RemoveShortcutYes(bool isYes, ShortcutControl control)
 {
     if (isYes)
     {
         Shortcuts.Remove(control);
         Wind.ShortcutListArea_ShortcutsParent.Children.Remove(control);
     }
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
        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;
            };
        }
Beispiel #10
0
 public SubShortcutControl(ShortcutControl parentControl)
 {
     parent = parentControl;
     InitializeComponent();
     InitControl(ShortcutType.Web);
 }
Beispiel #11
0
 public static void DuplicateShortcut(ShortcutControl control)
 {
     int             insertIndex = Shortcuts.IndexOf(control) + 1;
     Shortcut        newShortcut = control.Shortcut.Duplicate();
     ShortcutControl newControl  = AddShortcut(newShortcut, insertIndex);
 }