Esempio n. 1
0
        public void ReplaceTextInSegment(int segmentId, int startPosition, int endPosition, string replacementText)
        {
            var segmentPair = GetSegmentPair(segmentId);

            segmentPair?.Target.Replace(startPosition, endPosition, replacementText);

            _document.UpdateSegmentPair(segmentPair);
        }
Esempio n. 2
0
        private void SwitchTranslation(ISegmentPair segmentPair, ISegment updatedSegment, ISegmentPairProperties updatedProperties)
        {
            segmentPair.Target.Clear();
            foreach (var item in updatedSegment)
            {
                segmentPair.Target.Add(item.Clone() as IAbstractMarkupData);
            }

            _studioDocument.UpdateSegmentPair(segmentPair);


            segmentPair.Properties.ConfirmationLevel = updatedProperties.ConfirmationLevel;
            segmentPair.Properties.TranslationOrigin = updatedProperties.TranslationOrigin?.Clone() as ITranslationOrigin;
            segmentPair.Properties.IsLocked          = updatedProperties.IsLocked;
            _studioDocument.UpdateSegmentPairProperties(segmentPair, segmentPair.Properties);
        }