Skip to content

Instantly share code, notes, and snippets.

@cromica
Created June 2, 2015 11:53
Show Gist options
  • Select an option

  • Save cromica/c755798e710a09b153aa to your computer and use it in GitHub Desktop.

Select an option

Save cromica/c755798e710a09b153aa to your computer and use it in GitHub Desktop.
sample code showing how to update a paragraph properties using integration API
var segmentPair = _editorController.ActiveDocument.ActiveSegmentPair;
var paragraphProperties = segmentPair.GetParagraphUnitProperties();
var newComment = _editorController.ActiveDocument.PropertiesFactory.CreateComment("Test Comment", "Test author",
Severity.High);
if (paragraphProperties.Comments==null)
{
paragraphProperties.Comments = _editorController.ActiveDocument.PropertiesFactory.CreateCommentProperties();
}
if (paragraphProperties.Comments.Comments.All(x => x.Text != newComment.Text))
{
paragraphProperties.Comments.Add(newComment);
}
_editorController.ActiveDocument.UpdateParagraphUnitProperties(paragraphProperties);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment