Hello all,
I have run into an issue when using UpdateSegmentPair in the integration API for Studio 2015, and I'm not sure whether it is a bug or intended behavior.
When there are multiple documents open as one in the editor, it seems that after calling UpdateSegmentPair on the ActiveSegmentPair, the API resets the ActiveDocument.ActiveFile back to the first file in the editor, even if the current segment is in one of the later files. This is all well and good if you only need to update the segment once, but if you have to call UpdateSegmentPair a second time (or do anything with the ActiveSegmentPair), it will no longer point to the intended segment, but to the segment in the first file with the same Id.
Fortunately, there is a workaround (or necessary step if the behavior is intended). What I am currently doing is this:
1) Before calling UpdateSegmentPair I am storing a reference to the ActiveDocument.ActiveFile in a variable (as well as the ActiveSegmentPair.Id.Id).
2) Then I call UpdateSegmentPair
3) Then I call SetActiveSegmentPair({reference to the original ActiveFile}, {original Id}); this seems to reset the ActiveFile back to the original one.
So if anyone runs into the same problem, the above is a simple enough solution, but I was wondering whether or not it is a bug, in case anyone can answer.