private ToolStripMenuItem CreateDatabaseMenuItemForDocument(PwDocument document)
        {
            ToolStripMenuItemEx mainDropDownItem;

            if (!document.Database.IsOpen)
            {
                var documentName = UrlUtil.GetFileName(document.LockedIoc.Path);
                documentName    += " [" + Localization.Strings.Locked + "]";
                mainDropDownItem = new ToolStripMenuItemEx(documentName, Resources.TOTP_Error, OnClickOpenDatabase);
            }
            else
            {
                var documentName = UrlUtil.GetFileName(document.Database.IOConnectionInfo.Path);
                mainDropDownItem = new ToolStripMenuItemEx(documentName, ImageExtensions.CreateImageFromColor(document.Database.Color));
                mainDropDownItem.ForceDropDownArrow = true;
                mainDropDownItem.DropDownOpening   += OnDatabaseDropDownOpening;
                mainDropDownItem.DropDownOpening   += MenuItemHelper.OnDatabaseDropDownOpening;
            }

            mainDropDownItem.Tag = document;
            return(mainDropDownItem);
        }