public GameService(IClockService _clockService)
 {
     cache = new MemoryCacheManager();
 }
Esempio n. 2
0
 public CarToSmMapper(IClockService clockService)
 {
     _clockService = clockService;
 }
        public static async Task <TPublication> PopulatePublicationAsync <TPublication>(this TPublication publication,
                                                                                        IClockService clock, object newPublishedBy, CancellationToken cancellationToken = default)
            where TPublication : IObjectPublication
        {
            publication.NotNull(nameof(publication));

            var newPublishedTime = await StoreHelper.GetDateTimeNowAsync(clock,
                                                                         publication.CreatedTimeType, cancellationToken).ConfigureAwait();

            if (newPublishedTime.IsNotNull())
            {
                await publication.SetObjectCreatedTimeAsync(newPublishedTime, cancellationToken)
                .ConfigureAwait();

                await publication.SetObjectPublishedTimeAsync(newPublishedTime, cancellationToken)
                .ConfigureAwait();
            }

            await publication.SetObjectCreatedByAsync(newPublishedBy, cancellationToken)
            .ConfigureAwait();

            await publication.SetObjectPublishedByAsync(newPublishedBy, cancellationToken)
            .ConfigureAwait();

            return(publication);
        }
 public PaymentMethodToSavePaymentMethodMapper(IClockService clockService) =>
 this.clockService = clockService;
 public ValidateAccount2Module(IClockService clockService, IClassFactory classFactory)
     : base(clockService, classFactory)
 {
 }
 public HumanInputToHumanMapper(IClockService clockService) => this.clockService = clockService;
 /// <summary>
 /// 异步生成标识对象。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param>
 /// <returns>返回一个包含标识符对象的异步操作。</returns>
 public virtual async Task <object> GenerateObjectIdAsync(IClockService clock,
                                                          CancellationToken cancellationToken = default)
 => await GenerateIdAsync(clock, cancellationToken).ConfigureAwait();
Esempio n. 8
0
 public override string GenerateId(IClockService clock)
 => GenerateId(clock, out _);
 /// <summary>
 /// 异步生成标识。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param>
 /// <returns>返回一个包含 <typeparamref name="TId"/> 的异步操作。</returns>
 public abstract Task <TId> GenerateIdAsync(IClockService clock,
                                            CancellationToken cancellationToken = default);
 /// <summary>
 /// 生成标识对象。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <returns>返回标识符对象。</returns>
 public virtual object GenerateObjectId(IClockService clock)
 => GenerateId(clock);
 /// <summary>
 /// 生成标识。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <returns>返回 <typeparamref name="TId"/>。</returns>
 public abstract TId GenerateId(IClockService clock);
Esempio n. 12
0
 public MenuToSaveMenuMapper(IClockService clockService) =>
 this.clockService = clockService;
Esempio n. 13
0
 /// <summary>
 /// Create a new instance of <see cref="ServiceClock"/>.
 /// </summary>
 /// <param name="clockService">The WCF client</param>
 public ServiceClock(IClockService clockService)
 {
     _clockService = clockService;
 }
Esempio n. 14
0
 /// <summary>
 /// 构造一个 <see cref="AbstractPortalStoreIdentificationGenerator{TId}"/>。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <param name="factory">给定的 <see cref="IIdentificationGeneratorFactory"/>。</param>
 /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param>
 protected AbstractPortalStoreIdentificationGenerator(IClockService clock,
                                                      IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory)
     : base(clock, factory, loggerFactory)
 {
 }
 public CarToSaveCarTranslator(IClockService clockService) =>
 this.clockService = clockService;
Esempio n. 16
0
 public Clock(IClockService clock)
 {
     _clock = clock;
 }
 public ContactUsToSaveContactUsMapper(IClockService clockService)
 {
     _clockService = clockService;
 }
Esempio n. 18
0
 /// <summary>
 /// 异步生成标识。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param>
 /// <returns>返回一个包含字符串的异步操作。</returns>
 public override async Task <string> GenerateIdAsync(IClockService clock,
                                                     CancellationToken cancellationToken = default)
 => await GenerateIdDescriptorAsync(clock, cancellationToken).ConfigureAwait();
Esempio n. 19
0
        public bool IsBreakTime(IClockService clockService)
        {
            var now = clockService.Now();

            return(now - _lessonStartDateTime > new TimeSpan(1, 30, 00));
        }
Esempio n. 20
0
 public ExampleStoreIdentifierGenerator(IClockService clock,
                                        IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory)
     : base(clock, factory, loggerFactory)
 {
 }
Esempio n. 21
0
 public SlideContentToSaveSlideContentMapper(IClockService clockService) =>
 protected AccountingModuleBase(IClockService clockService, IClassFactory classFactory)
 {
     ClockService = clockService;
     ClassFactory = classFactory;
 }
Esempio n. 23
0
 public SystemSettingGroupToSaveSystemSettingGroupMapper(IClockService clockService) =>
Esempio n. 24
0
 public CentresService(ICentresDataService centresDataService, IClockService clockService)
 {
     this.centresDataService = centresDataService;
     this.clockService       = clockService;
 }
 public DatabaseService(IServiceResolver serviceResolver, IConfiguratorService configuratorService, IClockService clockService)
 {
     this.serviceResolver     = serviceResolver;
     this.configuratorService = configuratorService;
     this.clockService        = clockService;
 }
Esempio n. 26
0
 public UserRepository(IdentityEntities context, IContextService env)
     : base(context)
 {
     _clock = new ClockService(env);
 }
 /// <summary>
 /// 构造一个 <see cref="GuidContentStoreIdentificationGenerator"/>。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <param name="factory">给定的 <see cref="IIdentificationGeneratorFactory"/>。</param>
 /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param>
 public GuidContentStoreIdentificationGenerator(IClockService clock,
                                                IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory)
     : base(clock, factory, loggerFactory)
 {
 }
 /// <summary>
 /// 构造一个 <see cref="StringPortalStoreIdentificationGenerator"/>。
 /// </summary>
 /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
 /// <param name="factory">给定的 <see cref="IIdentificationGeneratorFactory"/>。</param>
 /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param>
 public StringPortalStoreIdentificationGenerator(IClockService clock,
                                                 IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory)
     : base(clock, factory, loggerFactory)
 {
 }
Esempio n. 29
0
        /// <summary>
        /// 异步生成标识。
        /// </summary>
        /// <param name="clock">给定的 <see cref="IClockService"/>。</param>
        /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param>
        /// <returns>返回一个包含字符串的异步操作。</returns>
        public virtual Task <MonggoIdentificationDescriptor> GenerateIdDescriptorAsync(IClockService clock,
                                                                                       CancellationToken cancellationToken = default)
        => cancellationToken.RunOrCancelAsync(() =>
        {
            var timestamp = GetTimestamp(clock);

            var buffer = ComputeHex(timestamp);
            return(MonggoIdentificationDescriptor.Create(buffer));
        });
Esempio n. 30
0
 /// <summary>
 /// Create a new instance of <see cref="ServiceClock"/>.
 /// </summary>
 /// <param name="clockService">The WCF client</param>
 public ServiceClock(IClockService clockService)
 {
     _clockService = clockService;
 }
Esempio n. 31
0
        private static int GetTimestamp(IClockService clock)
        {
            var ts = clock.GetNow() - ExtensionSettings.Preference.UnixEpoch;

            return(Convert.ToInt32(Math.Floor(ts.TotalSeconds)));
        }
Esempio n. 32
0
 public CarToSaveCarMapper(IClockService clockService) =>
 this.clockService = clockService;
 public ClockStoreViewModel(IClockService clockService)
 {
     _clockService = clockService;
 }