private void ReplaceInlineImages(IEnumerable <KeyValuePair <string, Guid> > createAttachments) { var imageReplacer = new ImageReplacer(); foreach (KeyValuePair <string, Guid> pair in createAttachments) { if (!imageReplacer.ContainsKey(pair.Key)) { imageReplacer.Add(pair.Key, pair.Value); } } if (imageReplacer.Count > 0) { _activityMessage.Body = imageReplacer.Replace(_activityMessage.Body); UpdateAM(); } }