private void textBox_TextChanged(object sender, EventArgs e)
 {
     // if the user edits the translation, then we have to update the map of maps
     if (!_bBlockSetModified)
     {
         TargetWordElement.ChangeTargetWordForm(textBox.Text);
         _parent.CallToSetModified();
     }
 }
        private Control AddToPanel(TargetWordElement targetWordElement)
        {
            var textBox = new TextBoxWithButtons(this)
            {
                TargetWordElement = targetWordElement,
                Font        = TargetWordFont,
                RightToLeft = TargetWordRightToLeft
            };

            flowLayoutPanelTargetWords.Controls.Add(textBox);
            return(textBox);
        }
        /// <summary>
        /// This method is used to (possibly) add a new word form (e.g. via AddNewPair)
        /// But if it already exists, then it just bumps the count.
        /// </summary>
        /// <param name="strRhs">the target word form</param>
        public void AddWord(string strRhs)
        {
            Debug.Assert(!String.IsNullOrEmpty(strRhs));
            // if there's already one...
            if (TargetWords().Any(twe => twe.TargetWord == strRhs))
            {
                // just return (I don't care about the "NumberOfOccurrences" that I should
                //  bump the count and it just seems to make the ChorusMerger go into an
                //  infinite processing loop when they're different
                return;
            }

            // otherwise, add this to the doc
            var targetWordElement = TargetWordElement.CreateNewTargetWordElement(strRhs,
                                                                                 ParentMap.ParentMapOfMaps.IsKbV2);

            Add(targetWordElement);
        }
 internal void Add(TargetWordElement targetWordElement)
 {
     Xml.Add(targetWordElement.Xml);
 }