예제 #1
0
        /// <summary>
        /// split the current occurrence into occurrences for each word in the phrase-wordform.
        /// (if it IsPhrase)
        /// </summary>
        public void OnBreakPhrase(object arg)
        {
            // (LT-8069) in some odd circumstances, the break phrase icon lingers on the tool bar menu when it should
            // have disappeared. If we're in that state, just return.
            if (!ShowBreakPhraseIcon)
            {
                return;
            }
            var cmd = (ICommandUndoRedoText)arg;

            UndoableUnitOfWorkHelper.Do(cmd.UndoText, cmd.RedoText, Cache.ActionHandlerAccessor,
                                        () => SelectedOccurrence.BreakPhrase());
            InterlinWordControl.SwitchWord(SelectedOccurrence);
            UpdateButtonState();
        }
예제 #2
0
        /// <summary>
        /// Note: Assume we are in the OnDisplayShowLinkWords is true context.
        /// </summary>
        public bool OnJoinWords(object arg)
        {
            var cmd = (ICommandUndoRedoText)arg;

            UndoableUnitOfWorkHelper.Do(cmd.UndoText, cmd.RedoText, Cache.ActionHandlerAccessor,
                                        () =>
            {
                SelectedOccurrence.MakePhraseWithNextWord();
                if (InterlinDoc != null)
                {
                    InterlinDoc.RecordGuessIfNotKnown(SelectedOccurrence);
                }
            });
            InterlinWordControl.SwitchWord(SelectedOccurrence);
            UpdateButtonState();
            return(true);
        }