mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-10-20 18:43:58 +00:00
Refactor MoreMenuProvider into Plugin partial class
This commit is contained in:
@@ -18,24 +18,21 @@
|
|||||||
using QuickLook.Common.Commands;
|
using QuickLook.Common.Commands;
|
||||||
using QuickLook.Common.Helpers;
|
using QuickLook.Common.Helpers;
|
||||||
using QuickLook.Common.Plugin.MoreMenu;
|
using QuickLook.Common.Plugin.MoreMenu;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace QuickLook.Plugin.MediaInfoViewer;
|
namespace QuickLook.Plugin.MediaInfoViewer;
|
||||||
|
|
||||||
public sealed class MoreMenuProvider
|
public partial class Plugin
|
||||||
{
|
{
|
||||||
public static Lazy<MoreMenuProvider> Instance { get; set; } = new(() => new());
|
|
||||||
|
|
||||||
public ICommand ShowWithMediaInfoCommand { get; }
|
public ICommand ShowWithMediaInfoCommand { get; }
|
||||||
|
|
||||||
public MoreMenuProvider()
|
public Plugin()
|
||||||
{
|
{
|
||||||
ShowWithMediaInfoCommand = new RelayCommand(ShowWithMediaInfo);
|
ShowWithMediaInfoCommand = new RelayCommand(ShowWithMediaInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IMenuItem> Get()
|
public IEnumerable<IMenuItem> GetMenuItems()
|
||||||
{
|
{
|
||||||
yield return new MoreMenuItem()
|
yield return new MoreMenuItem()
|
||||||
{
|
{
|
@@ -28,13 +28,13 @@ using System.Windows.Media;
|
|||||||
|
|
||||||
namespace QuickLook.Plugin.MediaInfoViewer;
|
namespace QuickLook.Plugin.MediaInfoViewer;
|
||||||
|
|
||||||
public class Plugin : IViewer, IMoreMenuExtended
|
public partial class Plugin : IViewer, IMoreMenuExtended
|
||||||
{
|
{
|
||||||
private TextViewerPanel _tvp;
|
private TextViewerPanel _tvp;
|
||||||
|
|
||||||
public int Priority => 0;
|
public int Priority => 0;
|
||||||
|
|
||||||
public IEnumerable<IMenuItem> MenuItems => MoreMenuProvider.Instance.Value.Get();
|
public IEnumerable<IMenuItem> MenuItems => GetMenuItems();
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user