Exemplo n.º 1
0
        public override bool Initialize(IPluginHost host)
        {
            if (host == null)
            {
                return(false);
            }
            this.host = host;


            this.ToolsMenuSettingsSubMenuItem        = new ToolStripMenuItem(KeeOtp2Statics.Settings);
            this.ToolsMenuSettingsSubMenuItem.Image  = host.MainWindow.ClientIcons.Images[(int)PwIcon.Configuration];
            this.ToolsMenuSettingsSubMenuItem.Click += settingsToolStripitem_Click;

            this.ToolsMenuAboutSubMenuItem        = new ToolStripMenuItem(KeeOtp2Statics.About);
            this.ToolsMenuAboutSubMenuItem.Image  = host.MainWindow.ClientIcons.Images[(int)PwIcon.Info];
            this.ToolsMenuAboutSubMenuItem.Click += aboutToolStripitem_Click;

            this.ToolsMenuMainItem       = new ToolStripMenuItem(KeeOtp2Statics.PluginName);
            this.ToolsMenuMainItem.Image = host.MainWindow.ClientIcons.Images[(int)PwIcon.Clock];
            this.ToolsMenuMainItem.DropDownItems.Add(this.ToolsMenuSettingsSubMenuItem);
            this.ToolsMenuMainItem.DropDownItems.Add(this.ToolsMenuAboutSubMenuItem);
            host.MainWindow.ToolsMenu.DropDownItems.Add(this.ToolsMenuMainItem);

            this.EntryContextMenuConfigureSubItem        = new ToolStripMenuItem(KeeOtp2Statics.ToolStripMenuConfigure);
            this.EntryContextMenuConfigureSubItem.Image  = host.MainWindow.ClientIcons.Images[(int)PwIcon.Clock];
            this.EntryContextMenuConfigureSubItem.Click += otpConfigureToolStripItem_Click;

            this.EntryContextMenuShowOtpSubItem        = new ToolStripMenuItem(KeeOtp2Statics.ToolStripMenuShowOtp);
            this.EntryContextMenuShowOtpSubItem.Image  = host.MainWindow.ClientIcons.Images[(int)PwIcon.Clock];
            this.EntryContextMenuShowOtpSubItem.Click += otpDialogToolStripItem_Click;

            this.EntryContextMenuCopySubItem        = new ToolStripMenuItem(KeeOtp2Statics.ToolStripMenuCopyOtp);
            this.EntryContextMenuCopySubItem.Image  = host.MainWindow.ClientIcons.Images[(int)PwIcon.Clock];
            this.EntryContextMenuCopySubItem.Click += otpCopyToolStripItem_Click;

            this.EntryContextMenuMainItem       = new ToolStripMenuItem(KeeOtp2Statics.PluginName);
            this.EntryContextMenuMainItem.Image = host.MainWindow.ClientIcons.Images[(int)PwIcon.Clock];
            this.EntryContextMenuMainItem.DropDownItems.Add(this.EntryContextMenuCopySubItem);
            this.EntryContextMenuMainItem.DropDownItems.Add(this.EntryContextMenuShowOtpSubItem);
            this.EntryContextMenuMainItem.DropDownItems.Add(this.EntryContextMenuConfigureSubItem);

            this.EntryContextMenuCopyItem              = new ToolStripMenuItem(KeeOtp2Statics.ToolStripMenuCopyOtp);
            this.EntryContextMenuCopyItem.Image        = host.MainWindow.ClientIcons.Images[(int)PwIcon.Clock];
            this.EntryContextMenuCopyItem.Click       += otpCopyToolStripItem_Click;
            this.EntryContextMenuCopyItem.ShortcutKeys = Keys.T | Keys.Control;


            host.MainWindow.EntryContextMenu.Items.Insert(2, this.EntryContextMenuCopyItem);
            host.MainWindow.EntryContextMenu.Items.Add(this.EntryContextMenuMainItem);
            host.MainWindow.EntryContextMenu.Opening += entryContextMenu_Opening;


            SprEngine.FilterCompile    += new EventHandler <SprEventArgs>(SprEngine_FilterCompile);
            SprEngine.FilterCompilePre += new EventHandler <SprEventArgs>(SprEngine_FilterCompilePre);

            KeeOtp2Config.handler = onHotKeyTriggered;
            KeeOtp2Config.loadConfig();

            return(true); // Initialization successful
        }
Exemplo n.º 2
0
        private void buttonSettings_Click(object sender, EventArgs e)
        {
            Settings settings = new Settings(this.host);

            settings.ShowDialog();

            if (settings.DialogResult == DialogResult.OK)
            {
                KeeOtp2Config.loadConfig();
            }
        }
Exemplo n.º 3
0
        private void settingsToolStripitem_Click(object sender, EventArgs e)
        {
            Settings settings = new Settings(this.host);

            settings.ShowDialog();

            if (settings.DialogResult == DialogResult.OK)
            {
                KeeOtp2Config.handler = onHotKeyTriggered;
                KeeOtp2Config.loadConfig();
            }
        }