예제 #1
0
        /// <summary>
        /// Adds a <see cref="ExcelThreadedComment"/> with mentions in the text to the thread.
        /// </summary>
        /// <param name="personId">Id of the <see cref="ExcelThreadedCommentPerson">autor</see></param>
        /// <param name="textWithFormats">A string with format placeholders - same as in string.Format. Index in these should correspond to an index in the <paramref name="personsToMention"/> array.</param>
        /// <param name="personsToMention">A params array of <see cref="ExcelThreadedCommentPerson"/>. Their DisplayName property will be used to replace the format placeholders.</param>
        /// <returns>The added <see cref="ExcelThreadedComment"/></returns>
        public ExcelThreadedComment AddComment(string personId, string textWithFormats, params ExcelThreadedCommentPerson[] personsToMention)
        {
            var comment = AddComment(personId, textWithFormats, true);

            MentionsHelper.InsertMentions(comment, textWithFormats, personsToMention);
            return(comment);
        }
예제 #2
0
 /// <summary>
 /// Edit the Text of an existing comment with mentions
 /// </summary>
 /// <param name="newTextWithFormats">A string with format placeholders - same as in string.Format. Index in these should correspond to an index in the <paramref name="personsToMention"/> array.</param>
 /// <param name="personsToMention">A params array of <see cref="ExcelThreadedCommentPerson"/>. Their DisplayName property will be used to replace the format placeholders.</param>
 public void EditText(string newTextWithFormats, params ExcelThreadedCommentPerson[] personsToMention)
 {
     Mentions.Clear();
     MentionsHelper.InsertMentions(this, newTextWithFormats, personsToMention);
     _thread.OnCommentThreadChanged();
 }