Example #1
0
 public void ProcessSmileys(InputModels.ProcessedMessageInput processedMessageInput)
 {
     for (var i = 0; i < SmileyRepository.Count(); i++)
     {
         var pattern     = $@"SMILEY_{i}_INDEX";
         var replacement = "<img src='" + SmileyRepository[i].Path + "' />";
         processedMessageInput.DisplayBody = Regex.Replace(processedMessageInput.DisplayBody, pattern, replacement);
     }
 }
Example #2
0
 public void PreProcessSmileys(InputModels.ProcessedMessageInput processedMessageInput)
 {
     for (var i = 0; i < SmileyRepository.Count(); i++)
     {
         var pattern     = @"(^|[\r\n\s])" + Regex.Escape(SmileyRepository[i].Code) + @"(?=$|[\r\n\s])";
         var replacement = $"$1SMILEY_{i}_INDEX";
         processedMessageInput.DisplayBody = Regex.Replace(processedMessageInput.DisplayBody, pattern, replacement, RegexOptions.Singleline);
     }
 }