void GlobalWindowManager_WindowAdded(object sender, GwmWindowEventArgs e)
        {
            OptionsForm optionsForm = e.Form as OptionsForm;
            if (optionsForm != null)
            {

                TabPage tp = new TabPage("QuickSearch");
                tp.BackColor = SystemColors.Window;
                tp.AutoScroll = true;
                OptionsControl optionsControl = new OptionsControl();
                //optionsControl.BackColor = SystemColors.Control;
                tp.Controls.Add(optionsControl);
                TabControl tc = optionsForm.Controls.Find("m_tabMain", false)[0] as TabControl;
                //System.Drawing.Image image = Resources.search_icon_16;
                //tc.ImageList.Images.Add("QuickSearch", image);
                //tp.ImageKey = "QuickSearch";
                tc.TabPages.Add(tp);
                //optionsForm.VisibleChanged += new EventHandler(delegate(object o, EventArgs em)
                //{
                //    em.
                //});
                optionsControl.Dock = DockStyle.Top;
                Button buttonOK = optionsForm.Controls.Find("m_btnOK", false)[0] as Button;
                buttonOK.Click += delegate(object senderr, EventArgs evtarg) {
                    optionsControl.OKButtonPressed(senderr, evtarg);
                    //removeBuiltinQuickFind(host);
                    this.qsControl.UpdateWidth();
                    //this.qsControl.
                    
                };
                //buttonOK.Click += new EventHandler(optionsControl.OKButtonPressed);

            }
        }
Ejemplo n.º 2
0
 private static void OnWindowRemoved(object sender, KeePass.UI.GwmWindowEventArgs e)
 {
     if (OptionsFormClosed == null)
     {
         return;
     }
     if (e.Form is OptionsForm)
     {
         OptionsFormsEventArgs o = new OptionsFormsEventArgs(m_of);
         OptionsFormClosed(sender, o);
     }
 }
Ejemplo n.º 3
0
 private static void OnWindowAdded(object sender, KeePass.UI.GwmWindowEventArgs e)
 {
     if (OptionsFormShown == null)
     {
         return;
     }
     if (e.Form is OptionsForm)
     {
         m_of        = e.Form as OptionsForm;
         m_of.Shown += OnOptionsFormShown;
         OptionsFormsEventArgs o = new OptionsFormsEventArgs(m_of);
         OptionsFormShown(sender, o);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Method to handle when a new window is opened.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void GlobalWindowManager_WindowAdded(object sender, GwmWindowEventArgs e)
        {
            // Get the password entry form
            PwEntryForm entryForm = e.Form as PwEntryForm;

            if (entryForm != null && CustomDateOptions.Count > 0)
            {
                ToolStripSeparator separator = new ToolStripSeparator();
                entryForm.DefaultTimesContextMenu.Items.Add(new ToolStripSeparator());

                // Add custom date options menu items.                
                CustomDateOptions.ForEach(o =>
                {
                    ToolStripMenuItem customOptionMenuItem = new ToolStripMenuItem(o.ToString());
                    customOptionMenuItem.Tag = o;
                    customOptionMenuItem.Click += customOptionMenuItem_Click;
                    entryForm.DefaultTimesContextMenu.Items.Add(customOptionMenuItem);
                });
            }
        }
Ejemplo n.º 5
0
        void GlobalWindowManager_WindowAdded(object sender, GwmWindowEventArgs e)
        {
            PwEntryForm ef = e.Form as PwEntryForm;
            if (ef != null)
            {
                ef.Shown += new EventHandler(editEntryFormShown);
                return;
            }

            GroupForm gf = e.Form as GroupForm;
            if (gf != null)
            {
                gf.Shown += new EventHandler(editGroupFormShown);
                return;
            }
        }
Ejemplo n.º 6
0
        //Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        //{
        //    MessageBox.Show("assembly: " + args.Name);
        //    AssemblyName name = new AssemblyName(args.Name);
        //    if (name.Name == "System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
        //    {
        //        return typeof(System.Web.HttpApplication).Assembly;
        //    }
        //    return null;
        //}
        void GlobalWindowManager_WindowAdded(object sender, GwmWindowEventArgs e)
        {
            //return; // not in 0.8 (soon after hopefully...)

            PwEntryForm ef = e.Form as PwEntryForm;
            if (ef != null)
            {
                ef.Shown += new EventHandler(editEntryFormShown);
                return;
            }

            GroupForm gf = e.Form as GroupForm;
            if (gf != null)
            {
                gf.Shown += new EventHandler(editGroupFormShown);
                return;
            }
        }
 void GlobalWindowManager_WindowAdded(object sender, GwmWindowEventArgs e)
 {
     PwEntryForm form = e.Form as PwEntryForm;
     if (form == null)
         return;
     form.Shown += form_Shown;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Modifies various Forms in KeePass
        /// </summary>
        ///<remarks>
        /// Kudos to the luckyrat for figuring out how to to this in KeePassRPC
        /// (KeeFox) and open-sourcing the code so I could copy/learn from it.
        ///</remarks>
        private void WindowAddedHandler(object aSender,
            GwmWindowEventArgs aEventArgs)
        {
            /* Add KeeAgent tab to PwEntryForm dialog */
              var pwEntryForm = aEventArgs.Form as PwEntryForm;
              if (pwEntryForm != null) {
            var optionsPanel = new EntryPanel(this);
            pwEntryForm.Shown +=
              delegate(object sender, EventArgs args)
              {
            pwEntryForm.AddTab(optionsPanel);
              };
            var foundControls = pwEntryForm.Controls.Find("m_btnOK", true);
            var okButton = foundControls[0] as Button;
            okButton.GotFocus += (sender, args) =>
            {
              if (optionsPanel.CurrentSettings != optionsPanel.IntialSettings) {
            pwEntryForm.EntryBinaries.SetKeeAgentSettings(optionsPanel.CurrentSettings);
              }
            };
            pwEntryForm.EntrySaving += PwEntryForm_EntrySaving;
            pwEntryForm.FormClosing += PwEntryForm_FormClosing;
              }

              /* Add KeeAgent tab to Database Settings dialog */
              var databaseSettingForm = aEventArgs.Form as DatabaseSettingsForm;
              if (databaseSettingForm != null) {
            databaseSettingForm.Shown +=
              delegate(object sender, EventArgs args)
              {
            var dbSettingsPanel =
              new DatabaseSettingsPanel(pluginHost.MainWindow.ActiveDatabase);
            databaseSettingForm.AddTab(dbSettingsPanel);
              };
              }

              /* Add KeeAgent tab to Options dialog */
              var optionsForm = aEventArgs.Form as OptionsForm;
              if (optionsForm != null) {
            optionsForm.Shown +=
              delegate(object sender, EventArgs args)
              {
            var optionsPanel = new OptionsPanel(this);
            optionsForm.AddTab(optionsPanel);
              };
            optionsForm.FormClosed += OptionsForm_FormClosed;
              }
        }