Exemple #1
0
        /// <summary>
        ///     Adds a message that replaces the <see cref="Message.Body" /> for channels that support
        ///     rich content (all channels except <see cref="Channel.SMS" />, <see cref="Channel.Voice" />
        ///     and <see cref="Channel.Push" /> at this moment)
        /// </summary>
        /// <param name="richMessage"></param>
        /// <returns></returns>
        public MessageBuilder WithRichMessage(IRichMessage richMessage)
        {
            if (this._richContent == null)
            {
                this._richContent = new RichContent();
            }

            this._richContent.AddConversionPart(richMessage);
            return(this);
        }
 /// <summary>
 ///     Adds a message, such as a <see cref="RichCard" /> or <see cref="TextMessage" />.
 /// </summary>
 /// <param name="part"></param>
 public void AddConversionPart(IRichMessage part)
 {
     if (this.Conversation == null)
     {
         this.Conversation = new[] { part }
     }
     ;
     else
     {
         var newArr = this.Conversation;
         Array.Resize(ref newArr, this.Conversation.Length + 1);
         newArr[newArr.Length - 1] = part;
         this.Conversation         = newArr;
     }
 }