Beispiel #1
0
 public SystemUserLogic(ISystemUserRepository systemUserRepository,
                        ICurrentTimeProvider currentTimeProvider)
     : base(systemUserRepository)
 {
     _systemUserRepository = systemUserRepository;
     _currentTimeProvider  = currentTimeProvider;
 }
Beispiel #2
0
        public TelemetryManager(IActiveSolutionBoundTracker solutionBindingTracker, ITelemetryDataRepository telemetryRepository, IVsVersionProvider vsVersionProvider,
                                ILogger logger, ITelemetryClient telemetryClient, ITelemetryTimer telemetryTimer, IKnownUIContexts knownUIContexts,
                                ICurrentTimeProvider currentTimeProvider)
        {
            this.solutionBindingTracker = solutionBindingTracker;
            this.telemetryRepository    = telemetryRepository;
            this.logger              = logger;
            this.telemetryClient     = telemetryClient;
            this.telemetryTimer      = telemetryTimer;
            this.knownUIContexts     = knownUIContexts;
            this.currentTimeProvider = currentTimeProvider;

            vsVersion = vsVersionProvider.Version;

            if (this.telemetryRepository.Data.InstallationDate == DateTimeOffset.MinValue)
            {
                this.telemetryRepository.Data.InstallationDate = currentTimeProvider.Now;
                this.telemetryRepository.Save();
            }

            if (IsAnonymousDataShared)
            {
                EnableAllEvents();
            }
        }
Beispiel #3
0
 public StatsFacade(IUnitOfWorkProvider unitOfWorkProvider, ICurrentUserProvider currentUserProvider, ICurrentTimeProvider currentTimeProvider,
                    IBrokerStatus brokerStatus)
     : base(unitOfWorkProvider, currentUserProvider)
 {
     _currentTimeProvider = currentTimeProvider;
     _brokerStatus        = brokerStatus;
 }
Beispiel #4
0
 public CancelOrderCommandValidator(
     ICoffeeRoastingEventRepository coffeeRoastingEventRepository,
     ICurrentTimeProvider currentTimeProvider)
 {
     _coffeeRoastingEventRepository = coffeeRoastingEventRepository;
     _currentTimeProvider           = currentTimeProvider;
 }
Beispiel #5
0
 public AlgorithmFacade(IUnitOfWorkProvider unitOfWorkProvider, ICurrentUserProvider currentUserProvider,
                        AlgorithmRepository algorithmRepository, ICurrentTimeProvider currentTimeProvider)
     : base(unitOfWorkProvider, currentUserProvider)
 {
     _algorithmRepository = algorithmRepository;
     _currentTimeProvider = currentTimeProvider;
 }
 public SendTextBlastCommandValidator(
     ICoffeeRoastingEventRepository coffeeRoastingEventRepository,
     ICurrentTimeProvider currentTimeProvider)
 {
     _coffeeRoastingEventRepository = coffeeRoastingEventRepository;
     _currentTimeProvider           = currentTimeProvider;
 }
Beispiel #7
0
 public BlogArticleLogic(IBlogArticleRepository articleRepository,
                         ICurrentTimeProvider currentTimeProvider,
                         IUnitOfWorkFactory unitOfWorkFactory)
     : base(articleRepository)
 {
     _articleRepository   = articleRepository;
     _currentTimeProvider = currentTimeProvider;
     _unitOfWorkFactory   = unitOfWorkFactory;
 }
 public QueryProjectShowcaseHandler(
     MemContext dbContext,
     ICurrentTimeProvider currentTimeProvider,
     UserManager <User> userManager)
 {
     this.dbContext           = dbContext;
     this.currentTimeProvider = currentTimeProvider;
     this.userManager         = userManager;
 }
 public CatService(
     IDbContext database,
     IRandomProvider randomProvider,
     ICurrentTimeProvider currentTimeProvider)
 {
     this.database            = database;
     this.randomProvider      = randomProvider;
     this.currentTimeProvider = currentTimeProvider;
 }
Beispiel #10
0
 public AddCategoriesHandler(
     MemContext dbContext,
     IMorphologicalAnalyzer <IpadicEntry> analyzer,
     ICurrentTimeProvider currentTimeProvider)
 {
     this.dbContext           = dbContext;
     this.analyzer            = analyzer;
     this.currentTimeProvider = currentTimeProvider;
 }
 public UpdateTranslationHandler(
     MemContext dbContext,
     IMorphologicalAnalyzer <IpadicEntry> analyzer,
     ICurrentTimeProvider currentTimeProvider)
 {
     this.dbContext           = dbContext;
     this.analyzer            = analyzer;
     this.currentTimeProvider = currentTimeProvider;
 }
Beispiel #12
0
 public AddContextHandler(
     MemContext dbContext,
     IMorphologicalAnalyzer <IpadicEntry> analyzer,
     ICurrentTimeProvider currentTimeProvider,
     UserManager <User> userManager)
 {
     this.dbContext           = dbContext;
     this.analyzer            = analyzer;
     this.currentTimeProvider = currentTimeProvider;
     this.userManager         = userManager;
 }
Beispiel #13
0
        public CoffeeRoastingEventPostRequestValidator(ICurrentTimeProvider currentTimeProvider)
        {
            RuleFor(req => req.Name)
            .NotNull()
            .NotEmpty();

            RuleFor(req => req.RoastDate)
            .NotNull()
            .GreaterThan(currentTimeProvider.Today);

            RuleForEach(req => req.CoffeeIds)
            .NotEmpty().When(req => req.CoffeeIds != null);

            RuleForEach(req => req.ContactIds)
            .NotEmpty().When(req => req.CoffeeIds != null);
        }
        public TelemetryManager(IActiveSolutionBoundTracker solutionBindingTracker, ITelemetryDataRepository telemetryRepository,
                                ILogger logger, ITelemetryClient telemetryClient, ITelemetryTimer telemetryTimer, IKnownUIContexts knownUIContexts,
                                ICurrentTimeProvider currentTimeProvider)
        {
            this.solutionBindingTracker = solutionBindingTracker ?? throw new ArgumentNullException(nameof(solutionBindingTracker));
            this.telemetryRepository    = telemetryRepository ?? throw new ArgumentNullException(nameof(telemetryRepository));
            this.logger              = logger ?? throw new ArgumentNullException(nameof(logger));
            this.telemetryClient     = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));
            this.telemetryTimer      = telemetryTimer ?? throw new ArgumentNullException(nameof(telemetryTimer));
            this.knownUIContexts     = knownUIContexts ?? throw new ArgumentNullException(nameof(knownUIContexts));
            this.currentTimeProvider = currentTimeProvider ?? throw new ArgumentNullException(nameof(currentTimeProvider));

            if (this.telemetryRepository.Data.InstallationDate == DateTimeOffset.MinValue)
            {
                this.telemetryRepository.Data.InstallationDate = currentTimeProvider.Now;
                this.telemetryRepository.Save();
            }

            if (IsAnonymousDataShared)
            {
                EnableAllEvents();
            }
        }
Beispiel #15
0
 private TelemetryManager CreateManager(ICurrentTimeProvider mockTimeProvider = null) => new TelemetryManager(activeSolutionTrackerMock.Object,
                                                                                                              telemetryRepositoryMock.Object, loggerMock.Object, telemetryClientMock.Object,
                                                                                                              telemetryTimerMock.Object, knownUIContexts.Object, mockTimeProvider ?? currentTimeProvider);
 public PriceZoneListProvider(DalContext dalContext, ICurrentTimeProvider currentTimeProvider)
 {
     _dalContext  = dalContext;
     _currentTime = currentTimeProvider;
 }
Beispiel #17
0
 public ProcessService(FileSystemWrapper fileSystemWrapper, ICurrentTimeProvider currentTimeProvider, ILogger <ProcessService> logger)
 {
     _fileSystemWrapper   = fileSystemWrapper;
     _currentTimeProvider = currentTimeProvider;
     _logger = logger;
 }
 public ITimerComponent With(ITimer timer, ICurrentTimeProvider timeProvider)
 {
     return new TimerComponent(timer, timeProvider);
 }
Beispiel #19
0
 public ClientsOrderService(DalContext context, ICurrentTimeProvider currentTime)
 {
     _context     = context;
     _currentTime = currentTime;
 }
Beispiel #20
0
 public SearchWithTwoLevelCache(ISearchCore s, ICurrentTimeProvider q)
 {
 }
Beispiel #21
0
 public UserProfileDAL(ICurrentTimeProvider currentTimeProvider, IUniqueIdProvider uniqueIdProvider, IMapper mapper)
 {
     _currentTimeProvider = currentTimeProvider;
     _uniqueIdProvider    = uniqueIdProvider;
     _mapper = mapper;
 }
 public ParkingLotService(IRepository <Data.ParkingLot> parkingLotRepository,
                          ICurrentTimeProvider currentTimeProvider)
 {
     this.parkingLotRepository = parkingLotRepository;
     this.currentTimeProvider  = currentTimeProvider;
 }
 public OrderManagementService(DalContext dalContext, ICurrentTimeProvider timeProvider)
 {
     _dalContext   = dalContext;
     _timeProvider = timeProvider;
 }
Beispiel #24
0
 public LoginLogic(ISystemUserRepository systemUserRepository,
                   ICurrentTimeProvider currentTimeProvider)
 {
     _systemUserRepository = systemUserRepository;
     _currentTimeProvider  = currentTimeProvider;
 }
Beispiel #25
0
 public PostFormatter(ICurrentTimeProvider timeProvider)
 {
     _timeProvider = timeProvider;
 }
Beispiel #26
0
        /// <summary>
        /// Determines whether this instance can process the specified current time.
        /// Applies a exponential increase to restarting, each retry results in a 2^number of retrys longer time between retrying.
        /// </summary>
        /// <param name="currentTime">The current time.</param>
        /// <returns>
        ///   <c>true</c> if this instance can process the specified current time; otherwise, <c>false</c>.
        /// </returns>
        public bool CanProcess(ICurrentTimeProvider currentTime)
        {
            if (this.Completed)
            {
                return false;
            }

            if (HasExpired(this, currentTime))
            {
                if (currentTime == null)
                {
                    throw new ArgumentNullException("currentTime");
                }

                double time = Math.Pow(2, this.RetryCount);
                TimeSpan ts = new TimeSpan(0, Convert.ToInt32(time), 0);

                DateTime nextstart;
                if (this.FailedOrTimedOutTime == null || this.FailedOrTimedOutTime == DateTime.MinValue)
                {
                    ////If it has expired but not yet had the failed or timed out set then we are processing a record from the database that has not
                    ////yet saved the time that it expired(or failed). we could Ignore it, but if something happend in the update of the failed or timeed out
                    ////time then we would never run this subscriber again. Instead lets restart it after the correct amount of time has elapsed
                    nextstart = this.StartTime + ts;
                    ////of course this could result in a subscriber that just lkeeps restarting over and over and failing (or timing out over and over)
                    ////need to add updating the store with retry count
                }
                else
                {
                    nextstart = this.FailedOrTimedOutTime + ts;
                }

                nextstart = this.FailedOrTimedOutTime + ts;

                if (DateTime.Compare(currentTime.Now, nextstart) < 0)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }

            return false; // all else fails return false to ensure it is ot restarted unnessarily
            //// it can always get picked up in the next loop
        }
 public AutoScalingGroupAlarmDataProvider(IAmazonCloudWatch cloudWatch, ICurrentTimeProvider timeProvider = null)
 {
     _cloudWatch   = cloudWatch;
     _timeProvider = timeProvider ?? new CurrentTimeProvider();
 }
Beispiel #28
0
        /// <summary>
        /// Determines whether the specified subscriber has expired by interogating the meta data.
        /// </summary>
        /// <param name="subscriberMetadata">The subscriber meta data.</param>
        /// <param name="currentTime">The current time.</param>
        /// <returns>
        ///   <c>true</c> if the specified subscriber meta data has expired; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">Argument Null Exception</exception>
        public static bool HasExpired(ISubscriberMetadata subscriberMetadata, ICurrentTimeProvider currentTime)
        {
            if (currentTime == null)
            {
                throw new ArgumentNullException("currentTime");
            }

            if (subscriberMetadata == null)
            {
                throw new ArgumentNullException("subscriberMetadata");
            }

            var nextstart = subscriberMetadata.StartTime + subscriberMetadata.TimeToExpire;
            if (DateTime.Compare(currentTime.Now, nextstart) > 0)
            {
                return true;
            }

            return false;
        }
Beispiel #29
0
 public WorkspaceDAL(ICurrentTimeProvider currentTimeProvider, IUniqueIdProvider uniqueIdProvider, IMapper mapper)
 {
     _currentTimeProvider = currentTimeProvider;
     _uniqueIdProvider    = uniqueIdProvider;
     _mapper = mapper;
 }
 public CreateCoffeeRoastingEventCommandValidator(ICurrentTimeProvider currentTimeProvider)
 {
     _currentTimeProvider = currentTimeProvider;
 }
 public OrderDeliveriesService(DalContext dalContext, ICurrentTimeProvider timeProvider)
 {
     _dalContext   = dalContext;
     _timeProvider = timeProvider;
 }