/// <summary> /// split the current annotation into annotations for each word in the phrase-wordform. /// (assume it IsPhrase) /// </summary> /// <param name="argument"></param> public void OnBreakPhrase(object argument) { // (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; // For now, suppress Undo/Redo since we're having difficulty // refreshing the Words record lists appropriately. // Since this action may irreversably overlap with current undo actions, clear the undo stack. // ITextStrings.ksUndoBreakPhrase; ITextStrings.ksRedoBreakPhrase; using (UndoRedoCommandHelper undoRedoHelper = new UndoRedoCommandHelper(Cache, argument as Command, false, true)) { using (SegmentFormsUpdateHelper sfuh = new SegmentFormsUpdateHelper(this)) { sfuh.BreakPhraseAnnotation(); } } return; }
/// <summary> /// Note: Assume we are in the OnDisplayShowLinkWords is true context. /// </summary> public bool OnJoinWords(object cmd) { // For now, suppress Undo/Redo since we're having difficulty // refreshing the Words record lists appropriately. // 1) Merge the current annotation with next twfic. // Since this action may irreversably overlap with current undo actions, clear the undo stack. //ITextStrings.ksUndoLinkWords; ITextStrings.ksRedoLinkWords; using (UndoRedoCommandHelper undoRedoHelper = new UndoRedoCommandHelper(Cache, cmd as Command, false, true)) { // any changes in the sandbox should be ignored. we don't want to try to save it. using (SegmentFormsUpdateHelper sfuh = new SegmentFormsUpdateHelper(this)) { sfuh.MergeAdjacentSegmentForms(); } } return true; }