Exemplo n.º 1
0
        public TopicRepository(
            ApplicationDbContext dbContext,
            UserContext userContext,
            BoardRepository boardRepository,
            MessageRepository messageRepository,
            PinRepository pinRepository,
            NotificationRepository notificationRepository,
            RoleRepository roleRepository,
            SettingsRepository settingsRepository,
            SmileyRepository smileyRepository,
            AccountRepository accountRepository,
            IActionContextAccessor actionContextAccessor,
            IUrlHelperFactory urlHelperFactory
            )
        {
            DbContext   = dbContext;
            UserContext = userContext;

            AccountRepository      = accountRepository;
            BoardRepository        = boardRepository;
            MessageRepository      = messageRepository;
            NotificationRepository = notificationRepository;
            PinRepository          = pinRepository;
            RoleRepository         = roleRepository;
            SettingsRepository     = settingsRepository;
            SmileyRepository       = smileyRepository;

            UrlHelper = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);
        }
Exemplo n.º 2
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);
     }
 }
Exemplo n.º 3
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);
     }
 }
Exemplo n.º 4
0
 public MessageRepository(
     ApplicationDbContext dbContext,
     UserContext userContext,
     BoardRepository boardRepository,
     SettingsRepository settingsRepository,
     SmileyRepository smileyRepository,
     AccountRepository accountRepository,
     IActionContextAccessor actionContextAccessor,
     IUrlHelperFactory urlHelperFactory,
     IImageStore imageStore,
     BBCodeParser bbcParser
     )
 {
     DbContext          = dbContext;
     UserContext        = userContext;
     BoardRepository    = boardRepository;
     SettingsRepository = settingsRepository;
     SmileyRepository   = smileyRepository;
     AccountRepository  = accountRepository;
     UrlHelper          = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);
     ImageStore         = imageStore;
     BBCParser          = bbcParser;
 }