protected override IList <TranslationMemory.SearchResults> SearchMultipleSegmentsInternal(TranslationMemory.SearchSettings settings, IList <Core.Segment> searchSegments) { lock (_serviceLockObject) { List <Core.Segment> translatedSegments = null; translatedSegments = new List <Core.Segment>(); foreach (Core.Segment segment in searchSegments) { Core.Segment translation = _service.Translate(segment); // If We Got Nothing Back, Create A Blank Segment To Prevent Errors Further Along if (translation == null) { translation = new Core.Segment(this.LanguageDirection.TargetCulture); } translatedSegments.Add(translation); } if (translatedSegments.Count != searchSegments.Count) { throw new Exception(PluginResources.EMSG_InvalidTranslationCount); } return(CreateSearchResultsFromTranslations(searchSegments, translatedSegments)); } }
protected override TranslationMemory.SearchResults SearchSingleSegmentInternal(TranslationMemory.SearchSettings settings, Core.Segment segment) { if (segment == null) { return(null); } lock (_serviceLockObject) { Core.Segment translation = _service.Translate(segment); return(CreateSearchResultFromTranslation(segment, translation)); } }