/// <summary>
        /// Handles clicks of context menu items corresponding to KeywordSets.
        /// </summary>
        ///
        /// <param name="keywordSet">
        /// The KeywordSet whose menu item was clicked.
        /// </param>

        private void OnKeywordSetMenuItemClicked(KeywordSet keywordSet)
        {
            var selectedLoc = this.locTree.SelectedNode?.Text;

            if (selectedLoc != null)
            {
                AddKeywordsToLocation(selectedLoc, keywordSet.Keywords);
            }
        }
        /// <summary>
        /// Adds a menu item for a KeywordSet to the keyword context menu.
        /// </summary>
        ///
        /// <param name="keywordSet">
        /// The KeywordSet to create a menu item for. Must not be null.
        /// </param>

        private void AddKeywordSetContextMenuItem(KeywordSet keywordSet)
        {
            var menuItem = new ToolStripMenuItem(keywordSet.Name);

            menuItem.Click += (sender, e) => OnKeywordSetMenuItemClicked(keywordSet);
            this.addKeywordContextMenu.Items.Add(menuItem);

            menuItem        = new ToolStripMenuItem(keywordSet.Name);
            menuItem.Click += (sender, e) => OnKeywordSetMenuItemClicked(keywordSet);
            this.keywordListContextMenu.Items.Add(menuItem);

            menuItem = new ToolStripMenuItem(keywordSet.Name);

            menuItem.Click += (sender, e) =>
            {
                foreach (string selectedLoc in this.locListBox.SelectedItems)
                {
                    AddKeywordsToLocation(selectedLoc, keywordSet.Keywords);
                }
            };

            this.flatLocListContextMenu.Items.Add(menuItem);
        }