Example #1
0
        private static CustomContextMenuStripEx Construct()
        {
            CustomContextMenuStripEx ctx = new CustomContextMenuStripEx();

            // Clone the image list in order to prevent event handlers
            // from the global client icons list to the context menu
            ctx.ImageList = UIUtil.CloneImageList(Program.MainForm.ClientIcons, true);

            bool bAppendSeparator = false;

            foreach (PwDocument ds in Program.MainForm.DocumentManager.Documents)
            {
                if (ds.Database.IsOpen)
                {
                    if (bAppendSeparator)
                    {
                        ctx.Items.Add(new ToolStripSeparator());
                    }

                    foreach (PwGroup pg in ds.Database.RootGroup.Groups)
                    {
                        ToolStripMenuItem tsmi = MenuCreateGroup(ds, pg);
                        ctx.Items.Add(tsmi);
                        MenuProcessGroup(ds, tsmi, pg);
                    }

                    bAppendSeparator = true;
                }
            }

            GlobalWindowManager.CustomizeControl(ctx);
            return(ctx);
        }
Example #2
0
 public void InitEx(string strTitle, string strDescShort,
                    string strDescLong, Image imgIcon, ImageList ilIcons,
                    PwObjectList <PwEntry> vEntries)
 {
     m_strTitle     = strTitle;
     m_strDescShort = strDescShort;
     m_strDescLong  = strDescLong;
     m_imgIcon      = imgIcon;
     m_ilIcons      = UIUtil.CloneImageList(ilIcons, true);
     m_vEntries     = vEntries;
 }
Example #3
0
        public void InitEx(string strTitle, string strSubTitle,
                           string strInfo, Image imgIcon, List <object> lData,
                           ImageList ilIcons, Action <ListView> fInit)
        {
            m_strTitle    = (strTitle ?? string.Empty);
            m_strSubTitle = (strSubTitle ?? string.Empty);
            m_strInfo     = (strInfo ?? string.Empty);
            m_imgIcon     = imgIcon;
            if (lData != null)
            {
                m_lData = lData;
            }

            if (ilIcons != null)
            {
                m_ilIcons = UIUtil.CloneImageList(ilIcons, true);
            }

            m_fInit = fInit;
        }
Example #4
0
 public void InitEx(List <AutoTypeCtx> lCtxs, ImageList ilIcons)
 {
     m_lCtxs   = lCtxs;
     m_ilIcons = UIUtil.CloneImageList(ilIcons, true);
 }