Exemplo n.º 1
0
 public AccountCreatedIntegrationEventHandler(IIpInformationService ipInformation, IGravatarService gravatar,
                                              IKafkaMessageBus bus)
 {
     _ipInformation = ipInformation;
     _gravatar      = gravatar;
     _bus           = bus;
 }
Exemplo n.º 2
0
 public TopicModelBuilder(AtlasDbContext dbContext,
                          ICacheManager cacheManager,
                          IGravatarService gravatarService)
 {
     _dbContext       = dbContext;
     _cacheManager    = cacheManager;
     _gravatarService = gravatarService;
 }
Exemplo n.º 3
0
        public GetAll()
        {
            _fakeRepository      = new FakeRepository();
            _fakeGravatarService = new FakeGravatarService();
            SpeakerFactory.Create(_fakeRepository);

            _speakerService = new SpeakerService(_fakeRepository, _fakeGravatarService);
        }
Exemplo n.º 4
0
 public ChangeAvatarController(IAuthService authService, IProfileService profileService, IAvatarService avatarService, IAvatarFilesService avatarFilesService, IGravatarService gravatarService)
 {
     _authService        = authService;
     _profileService     = profileService;
     _avatarService      = avatarService;
     _avatarFilesService = avatarFilesService;
     _gravatarService    = gravatarService;
 }
Exemplo n.º 5
0
 public UserModelBuilder(AtlasDbContext dbContext,
                         ICacheManager cacheManager,
                         IGravatarService gravatarService,
                         ISearchModelBuilder searchModelBuilder)
 {
     _dbContext          = dbContext;
     _cacheManager       = cacheManager;
     _gravatarService    = gravatarService;
     _searchModelBuilder = searchModelBuilder;
 }
Exemplo n.º 6
0
 public ContextService(IHttpContextAccessor httpContextAccessor,
                       ICacheManager cacheManager,
                       AtlesDbContext dbContext,
                       IGravatarService gravatarService)
 {
     _httpContextAccessor = httpContextAccessor;
     _cacheManager        = cacheManager;
     _dbContext           = dbContext;
     _gravatarService     = gravatarService;
 }
Exemplo n.º 7
0
        public MenuControlViewModel(INavigationService navigationService, IAccountService accountService, IRestService restservice, IInternetConnectionService internetConnectionService, IGravatarService gravatarService) : base(navigationService)
        {
            Messenger.Default.Register <MessageToMenuControl>(this, x => HandleMenuControlMessage(x.SearchButton, x.SaveButton, x.TitleString));


            _accountService            = accountService;
            _internetConnectionService = internetConnectionService;
            _restservice     = restservice;
            _gravatarService = gravatarService;

            LogoutButtonVisibility = _accountService.IsUserLoggedIn();
            SearchVisibility       = false;
            GetGravatar();
        }
Exemplo n.º 8
0
 public BlogService(IPandaDataProvider dataProvider, IMapper mapper,
                    IMediaStorageService mediaStorageService, ISlugService slugService,
                    IEmailService emailService, IDataProtectionProvider dataProtectionProvider,
                    IGravatarService gravatarService, IReCaptchaValidator reCaptchaValidator)
 {
     _dataProvider        = dataProvider;
     _mapper              = mapper;
     _mediaStorageService = mediaStorageService;
     _slugService         = slugService;
     _emailService        = emailService;
     _protector           = dataProtectionProvider.CreateProtector("Panda.BlogService");
     _gravatarService     = gravatarService;
     _reCaptchaValidator  = reCaptchaValidator;
 }
        public CommentsModule(IBarCodes barCodes, IComments comments,
                              IUsers users, IEventLog eventLog, IGravatarService gravatarService) : base("/Comment")
        {
            this.RequiresAuthentication();

            this.barCodes        = barCodes;
            this.comments        = comments;
            this.users           = users;
            this.eventLog        = eventLog;
            this.gravatarService = gravatarService;

            Get["/{id}"] = x =>
            {
                if (!this.barCodes.Exists(x.id))
                {
                    return(Response.AsJson(Enumerable.Empty <Comment>()));
                }

                IEnumerable <Comment> commentsForBarCode = this.comments.GetCommentsForBarCode(x.id);
                Comment[]             ret =
                    this.gravatarService.AddAvatarToComments(commentsForBarCode).ToArray();
                return(Response.AsJson(ret));
            };

            Post["/{id}"] = x =>
            {
                if (!this.barCodes.Exists(x.id))
                {
                    return(Response.AsJson(Enumerable.Empty <Comment>()));
                }

                Comment comment = this.Bind <Comment>();
                comment.Author = this.users.GetIdByUsername(this.Context.CurrentUser.UserName);

                this.comments.Add(comment);
                Comment[] commentsForBarCode = this.comments.GetCommentsForBarCode(x.id).ToArray();
                this.Log(x.id, comment.Author, "COMMENT", comment.Text);
                return(Response.AsJson(commentsForBarCode));
            };
        }
        public CommentsModule(IBarCodes barCodes, IComments comments, 
            IUsers users, IEventLog eventLog, IGravatarService gravatarService)
            : base("/Comment")
        {
            this.RequiresAuthentication();

            this.barCodes = barCodes;
            this.comments = comments;
            this.users = users;
            this.eventLog = eventLog;
            this.gravatarService = gravatarService;

            Get["/{id}"] = x =>
                               {
                                   if (!this.barCodes.Exists(x.id))
                                       return Response.AsJson(Enumerable.Empty<Comment>());

                                   IEnumerable<Comment> commentsForBarCode = this.comments.GetCommentsForBarCode(x.id);
                                   Comment[] ret =
                                       this.gravatarService.AddAvatarToComments(commentsForBarCode).ToArray();
                                   return Response.AsJson(ret);
                               };

            Post["/{id}"] = x =>
                                {
                                    if (!this.barCodes.Exists(x.id))
                                        return Response.AsJson(Enumerable.Empty<Comment>());

                                    Comment comment = this.Bind<Comment>();
                                    comment.Author = this.users.GetIdByUsername(this.Context.CurrentUser.UserName);

                                    this.comments.Add(comment);
                                    Comment[] commentsForBarCode = this.comments.GetCommentsForBarCode(x.id).ToArray();
                                    this.Log(x.id, comment.Author, "COMMENT", comment.Text);
                                    return Response.AsJson(commentsForBarCode);
                                };
        }
Exemplo n.º 11
0
 public GetAll(ContextFixture fixture)
 {
     _repository      = new Repository <Speaker>(fixture.Context);
     _gravatarService = new GravatarService();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GravatarsViewModel"/> class.
 /// </summary>
 /// <param name="gravatarService">The gravatar service.</param>
 /// <remarks></remarks>
 public GravatarsViewModel(IGravatarService gravatarService)
 {
     Persons = new CollectionView(gravatarService.Persons);
 }
        public void SetUp()
        {
            _profileProvider = Substitute.For <IProfileProvider>();

            _gravatarService = new GravatarService(_profileProvider);
        }
 public EmailToGravatarConverter(IGravatarService gravatarService)
 {
     _gravatarService = gravatarService;
 }
Exemplo n.º 15
0
 public SpeakerService(object fakeRepository, IGravatarService fakeGravatarService)
 {
     _fakeRepository          = fakeRepository;
     this.fakeGravatarService = fakeGravatarService;
 }
Exemplo n.º 16
0
 public SpeakerService(IRepository <Models.Speaker> repository, IGravatarService gravatarService)
 {
     _repository      = repository;
     _gravatarService = gravatarService;
 }
Exemplo n.º 17
0
        public CachedGravatarService(IGravatarService decoratedGravatarService)
        {
            _decoratedGravatarService = decoratedGravatarService;

            _cache = new ConcurrentDictionary <string, ProfileInfo>();
        }