how to modify a target segment?

Hello,

I am currently working on several projects where automatical changes in target segments are needed and I would like to perform them with the editor controller of the integration API. But I couldn't find any piece of code or explanation about segment changes?

The only clue I found (maybe!) is the ProcessSegmentPairs method which description in the documentation is minimal.

Can someone tell me how to process?

Many thanks

Sébastien

Parents Reply
  • Hi Romulus,

    I managed to change existing target segments, but cannot handle empty Target Segment case.

    I have tried to add a new target segment: created by ActiveDocument.ActiveSegmentPair.CreateSegment(ISegmentPairProperties properties).

    But after call of following code, the UI freezes:

    if (segmentPair.Target.Count == 0) {
    
     var segment = CreateSegment(answer, segmentPair.Properties);
    
     segmentPair.Target.Add(segment);
    
     _editorController.ActiveDocument.UpdateSegmentPair(segmentPair);
    
    }

     Can you help me, how to:

    1) Create successfully a target segment (with a simple IText content)

    2) Or Copy source to target (as a workaround)

    Thanks

Children