Adding comments to segments

Hi,

I would like to add comments to paragraphunits in an existing sdlxliff document this way:

var pup = Controller.ActiveDocument.ActiveSegmentPair.GetParagraphUnitProperties();
pup.Comments = CreateComment(doc.PropertiesFactory, "abc", "xyz");

where

ICommentProperties CreateComment(IPropertiesFactory pf, string commentText, string origin)
{
var commentProperties = pf.CreateCommentProperties();
var comment = pf.CreateComment(commentText, origin, Sdl.FileTypeSupport.Framework.NativeApi.Severity.Low);
commentProperties.Add(comment);

return commentProperties;
}

But this does not seem to change the original segment. When I query the ParagraphUnitProperties again, the comments property is null again.

I also tried to reach the paragraphunit as ActiveSegmentPair.Target.ParentParagraphUnit, but it returns null.

Does anyone have an idea how to add comments (maybe also structure info) to existing segments?

Thanks,

Tamas