public TrayMenuItemProvider(KeeTrayTOTPExt plugin, IPluginHost pluginHost) { Plugin = plugin; DocumentManager = pluginHost.MainWindow.DocumentManager; PluginHost = pluginHost; PluginHost.MainWindow.TrayContextMenu.Opened += TrayContextMenu_Opened; }
public static (KeeTrayTOTPExt plugin, Mock <IPluginHost> pluginHost) Create() { var plugin = new KeeTrayTOTPExt(); var pluginHost = new Mock <IPluginHost>(MockBehavior.Strict); pluginHost.SetupGet(c => c.MainWindow).Returns(new MainForm()); pluginHost.SetupGet(c => c.CustomConfig).Returns(new AceCustomConfig()); pluginHost.SetupGet(c => c.ColumnProviderPool).Returns(new ColumnProviderPool()); return(plugin, pluginHost); }
public MenuItemProvider(KeeTrayTOTPExt plugin, IPluginHost pluginHost) { if (plugin.Settings.LegacyTrayMenuProviderEnable) { TrayMenuItemProvider = new LegacyTrayMenuItemProvider(plugin, pluginHost); } else { TrayMenuItemProvider = new TrayMenuItemProvider(plugin, pluginHost); } EntryMenuItemProvider = new EntryMenuItemProvider(plugin, pluginHost); MainMenuItemProvider = new MainMenuItemProvider(plugin); }
private static KeeTrayTOTPExt CreatePluginHostMock(out Mock <IPluginHost> host) { var plugin = new KeeTrayTOTPExt(); host = new Mock <IPluginHost>(MockBehavior.Strict); var keepassForm = new MainForm(); host.SetupGet(c => c.MainWindow).Returns(keepassForm); var customConfig = new AceCustomConfig(); host.SetupGet(c => c.CustomConfig).Returns(customConfig); var columnProviderPool = new ColumnProviderPool(); host.SetupGet(c => c.ColumnProviderPool).Returns(columnProviderPool); return(plugin); }
private static (KeeTrayTOTPExt, IPluginHost) CreateInitializedPlugin() { var plugin = new KeeTrayTOTPExt(); var pluginHost = new Mock <IPluginHost>(MockBehavior.Strict); var keepassForm = new MainForm(); pluginHost.SetupGet(c => c.MainWindow).Returns(keepassForm); var customConfig = new AceCustomConfig(); pluginHost.SetupGet(c => c.CustomConfig).Returns(customConfig); var columnProviderPool = new ColumnProviderPool(); pluginHost.SetupGet(c => c.ColumnProviderPool).Returns(columnProviderPool); plugin.Initialize(pluginHost.Object); return(plugin, pluginHost.Object); }
public MainMenuItemProvider(KeeTrayTOTPExt plugin) { _plugin = plugin; }
public LegacyTrayMenuItemProvider(KeeTrayTOTPExt plugin, IPluginHost pluginHost) : base(plugin, pluginHost) { SetUpLegacyContextMenuEntries(); }
public EntryMenuItemProvider(KeeTrayTOTPExt plugin, IPluginHost pluginHost) { _plugin = plugin; _pluginHost = pluginHost; }