public static ImageSource GetShortcutIcon(this Shortcut shortcut, ViewModel viewModel)
        {
            if (!viewModel.Settings.UseIconCache)
                return GetShortcutIcon(shortcut);

            if (!viewModel.IconCache.ContainsKey(shortcut.ProcessFile.Path))
                viewModel.IconCache.Add(shortcut.ProcessFile.Path, GetShortcutIcon(shortcut));
            return viewModel.IconCache[shortcut.ProcessFile.Path];
        }
Esempio n. 2
0
 public static Shortcut MoveDown(this ViewModel viewModel, Shortcut shortcut, bool toEnd = false)
 =>
 toEnd
             ? viewModel.Settings.Shortcuts.MoveToBottom(shortcut)
             : viewModel.Settings.Shortcuts.MoveDown(shortcut);
Esempio n. 3
0
 public static Shortcut MoveUp(this ViewModel viewModel, Shortcut shortcut, bool toEnd = false)
 => toEnd?viewModel.Settings.Shortcuts.MoveToTop(shortcut) : viewModel.Settings.Shortcuts.MoveUp(shortcut);
Esempio n. 4
0
 public static void ForceRefresh(this ViewModel viewModel)
 {
     viewModel.ClearIconCache();
 }
Esempio n. 5
0
 public static void NewSeparator(this ViewModel viewModel)
 {
     viewModel.Add(new Shortcut {
         Name = "Separator", SpecialType = "Separator"
     }, false);
 }
 public ManageShortcuts(ViewModel viewModel)
 {
     InitializeComponent();
     ViewModel = viewModel;
     DataContext = this;
 }