当前位置: 首页>>代码示例>>C#>>正文


C# ITimeProvider类代码示例

本文整理汇总了C#中ITimeProvider的典型用法代码示例。如果您正苦于以下问题:C# ITimeProvider类的具体用法?C# ITimeProvider怎么用?C# ITimeProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ITimeProvider类属于命名空间,在下文中一共展示了ITimeProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        public void Init(Func< bool > shouldPauseCb, ITimeProvider time, WeaponConfig config, Rect levelBounds, int shotDirection)
        {
            base.Init( shouldPauseCb, time, config, levelBounds );

            PrefabPoolManager.Prepare( ShotPrefabLink, 8);
            ShotDirection = shotDirection;
        }
开发者ID:forwolk,项目名称:HamburgTest,代码行数:7,代码来源:ProjectileWeapon.cs

示例2: BrowserExecutionContextCreator

 public BrowserExecutionContextCreator(IBrowserStepExecutionStrategyFactory stepExecutionStrategyFactory,
     IWebDriverFactory webDriverFactory, ITimeProvider timeProvider)
 {
     _stepExecutionStrategyFactory = stepExecutionStrategyFactory;
     _webDriverFactory = webDriverFactory;
     _timeProvider = timeProvider;
 }
开发者ID:AcklenAvenue,项目名称:Pepino,代码行数:7,代码来源:BrowserExecutionContextCreator.cs

示例3: Init

 public virtual void Init(Func<bool> shouldPauseCb, ITimeProvider time, WeaponConfig config, Rect levelBounds)
 {
     base.Init( shouldPauseCb, time);
     Config = config;
     LevelBounds = levelBounds;
     ShotFiredTimeStamp = Time.Time;
 }
开发者ID:forwolk,项目名称:HamburgTest,代码行数:7,代码来源:BaseWeapon.cs

示例4: SecureCookieProvider

 public SecureCookieProvider(ITimeProvider timeProvider)
 {
     string key = ConfigurationManager.AppSettings.Get("CookieKey");
     string salt = ConfigurationManager.AppSettings.Get("CookieSalt");
     crypto = CryptoFactory.Rijndael(key, salt);
     this.timeProvider = timeProvider;
 }
开发者ID:Zyprexia,项目名称:SolidMvp,代码行数:7,代码来源:SecureCookieProvider.cs

示例5: EvalDailyTrigger

        public static bool EvalDailyTrigger(this IDailyScheduledTask task, ITimeProvider timeProvider)
        {
            if (task.RepeatIntervalInDays <= 0 || ((Int32)(timeProvider.Time.Date - task.StartTime.Date).TotalDays % task.RepeatIntervalInDays != 0))
                return false;

            return TimeHelpers.AreTimesEqualToTheSecond(timeProvider.Time, task.StartTime);
        }
开发者ID:m19brandon,项目名称:zVirtualScenes,代码行数:7,代码来源:DailyTaskExtensionMethods.cs

示例6: Create

 public static IReaderStrategy Create(
     ISourceDefinitionConfigurator sources, ITimeProvider timeProvider, IPrincipal runAs)
 {
     var builder = new Builder();
     sources.ConfigureSourceProcessingStrategy(builder);
     return builder.Build(timeProvider, runAs);
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:7,代码来源:ReaderStrategy.cs

示例7: MainWindow

        public MainWindow(ITimeProvider provider)
        {

            LogTimeCommand = new DelegateCommand( ActionLogTime );
            _provider = provider;
            DataContext = this;

            Directory.CreateDirectory( "Work" );

            var doc = XDocument.Load( "config.xml" );
            _breakElements = doc.XPathSelectElements("//Break").ToList();

         
            var catList = doc.XPathSelectElements("//Category").Select(e => e.Value).ToList();
            Cats = new ObservableCollection< string >(catList);
            
#if DEBUG

            for ( var i = 0; i < 10; ++i )
            {
                Cats.Add( "Project "+i );
            }
#endif



            InitializeComponent();


            _dumpBreaks();


            list.IsEnabled = false;


            // Disable updater for now, fake time
           /* {
                startTime.Text = "8:00";
                _doNotUpdate = true;
            }*/

            //_doNotUpdate = false;
            _updater = Task.Run( () =>
            {

                while ( true )
                {
                    if ( DoNotUpdate == false )
                    {
                        startTime.Dispatcher.Invoke( () => startTime.Text = DateTime.Now.ToString( "HH:mm:ss" ) );
                    }
                    //startTime.Dispatcher.Invoke(() =>  startTime.Text = SystemClock.Instance.Now.ToString("HH:mm", null));
                   


                    Thread.Sleep( 1000 );
                }
            } ).ContinueWith( ErrorFunc );

        }
开发者ID:Seikilos,项目名称:TimeTracker,代码行数:60,代码来源:MainWindow.xaml.cs

示例8: SystemInformationProvider

        public SystemInformationProvider(ITimeProvider timeProvider, IMachineNameProvider machineNameProvider, ISystemPerformanceDataProvider systemPerformanceDataProvider, IHttpStatusCodeCheckResultProvider httpStatusCodeCheckResultProvider)
        {
            if (timeProvider == null)
            {
                throw new ArgumentNullException("timeProvider");
            }

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

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

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

            this.timeProvider = timeProvider;
            this.machineNameProvider = machineNameProvider;
            this.systemPerformanceDataProvider = systemPerformanceDataProvider;
            this.httpStatusCodeCheckResultProvider = httpStatusCodeCheckResultProvider;
        }
开发者ID:andreaskoch,项目名称:SignalKo-SystemMonitor,代码行数:27,代码来源:SystemInformationProvider.cs

示例9: ReaderSubscriptionBase

        protected ReaderSubscriptionBase(
            IPublisher publisher,
            Guid subscriptionId,
            CheckpointTag @from,
            IReaderStrategy readerStrategy,
            ITimeProvider timeProvider,
            long? checkpointUnhandledBytesThreshold,
            int? checkpointProcessedEventsThreshold,
            bool stopOnEof,
            int? stopAfterNEvents)
        {
            if (publisher == null) throw new ArgumentNullException("publisher");
            if (readerStrategy == null) throw new ArgumentNullException("readerStrategy");
            if (timeProvider == null) throw new ArgumentNullException("timeProvider");
            if (checkpointProcessedEventsThreshold > 0 && stopAfterNEvents > 0)
                throw new ArgumentException("checkpointProcessedEventsThreshold > 0 && stopAfterNEvents > 0");

            _publisher = publisher;
            _readerStrategy = readerStrategy;
            _timeProvider = timeProvider;
            _checkpointUnhandledBytesThreshold = checkpointUnhandledBytesThreshold;
            _checkpointProcessedEventsThreshold = checkpointProcessedEventsThreshold;
            _stopOnEof = stopOnEof;
            _stopAfterNEvents = stopAfterNEvents;
            _subscriptionId = subscriptionId;
            _lastPassedOrCheckpointedEventPosition = null;

            _eventFilter = readerStrategy.EventFilter;

            _positionTagger = readerStrategy.PositionTagger;
            _positionTracker = new PositionTracker(_positionTagger);
            _positionTracker.UpdateByCheckpointTagInitial(@from);
        }
开发者ID:danieldeb,项目名称:EventStore,代码行数:33,代码来源:ReaderSubscriptionBase.cs

示例10: CommandCreator

 protected CommandCreator(IOutputManager outputManager, ITimeProvider timeProvider, IMessagesRepository messagesRepository, IFollowingRepository followingRepository)
 {
     OutputManager = outputManager;
     TimeProvider = timeProvider;
     MessagesRepository = messagesRepository;
     FollowingRepository = followingRepository;
 }
开发者ID:micheledicosmo,项目名称:retrotwitter,代码行数:7,代码来源:CommandCreators.cs

示例11: EvalWeeklyTrigger

 public static bool EvalWeeklyTrigger(this IWeeklyScheduledTask task, ITimeProvider timeProvider)
 {
     if (task.RepeatIntervalInWeeks <= 0 || (((Int32)(timeProvider.Time.Date - task.StartTime.Date).TotalDays / 7) % task.RepeatIntervalInWeeks != 0)) return false;
     var dayOfWeek = (int)timeProvider.Time.DayOfWeek;
     var daysOfWeek = (DaysOfWeek)(1 << dayOfWeek);
     return task.DaysOfWeekToActivate.HasFlag(daysOfWeek) && TimeHelpers.AreTimesEqualToTheSecond(timeProvider.Time, task.StartTime);
 }
开发者ID:ruisebastiao,项目名称:zVirtualScenes,代码行数:7,代码来源:WeeklyTaskExtensionMethods.cs

示例12: CalculateStoreOmittedOrPartlyCompletedShotPoints

 public void CalculateStoreOmittedOrPartlyCompletedShotPoints(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if this was previously done
     // Store the data
     // TODO - SHOULD THIS BE VISUALISED
     // Issue OmittedOrPartlyCompletedShotPointsStored event
 }
开发者ID:11646729,项目名称:iSeismic,代码行数:7,代码来源:DrillingDepartmentAggregate.cs

示例13: AddPlannedWorkgroup

        public void AddPlannedWorkgroup(DrillingDepartmentId id, RequestId requestId, WorkgroupEntity we, ITimeProvider provider)
        {
            // Create the Planned Workgroup
            DoWork("Create a Planned Workgroup and add to the Drilling Department Structure");

            RecordAndRealizeThat(new PlannedWorkgroupAddedToDepartment(id, requestId, we, provider.GetUtcNow()));
        }
开发者ID:11646729,项目名称:iSeismic,代码行数:7,代码来源:DrillingDepartmentAggregate.cs

示例14: CreateProcessingPhases

        public override sealed IProjectionProcessingPhase[] CreateProcessingPhases(
            IPublisher publisher, Guid projectionCorrelationId, PartitionStateCache partitionStateCache,
            Action updateStatistics, CoreProjection coreProjection, ProjectionNamesBuilder namingBuilder,
            ITimeProvider timeProvider, IODispatcher ioDispatcher,
            CoreProjectionCheckpointWriter coreProjectionCheckpointWriter)
        {
            var definesFold = _sourceDefinition.DefinesFold;

            var readerStrategy = CreateReaderStrategy(timeProvider);

            var zeroCheckpointTag = readerStrategy.PositionTagger.MakeZeroCheckpointTag();

            var checkpointManager = CreateCheckpointManager(
                projectionCorrelationId, publisher, ioDispatcher, namingBuilder, coreProjectionCheckpointWriter,
                definesFold, readerStrategy);


            var resultWriter = CreateFirstPhaseResultWriter(
                checkpointManager as IEmittedEventWriter, zeroCheckpointTag, namingBuilder);

            var firstPhase = CreateFirstProcessingPhase(
                publisher, projectionCorrelationId, partitionStateCache, updateStatistics, coreProjection,
                _subscriptionDispatcher, zeroCheckpointTag, checkpointManager, readerStrategy, resultWriter);

            return CreateProjectionProcessingPhases(
                publisher, projectionCorrelationId, namingBuilder, partitionStateCache, coreProjection, ioDispatcher,
                firstPhase);
        }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:28,代码来源:DefaultProjectionProcessingStrategy.cs

示例15: setup

        public void setup()
        {
            _checkpointUnhandledBytesThreshold = 1000;
            _checkpointProcessedEventsThreshold = 2000;
            Given();
            _bus = new InMemoryBus("bus");
            _timeProvider = new RealTimeProvider();
            _projectionCorrelationId = Guid.NewGuid();
            _eventHandler = new TestHandler<EventReaderSubscriptionMessage.CommittedEventReceived>();
            _checkpointHandler = new TestHandler<EventReaderSubscriptionMessage.CheckpointSuggested>();
            _progressHandler = new TestHandler<EventReaderSubscriptionMessage.ProgressChanged>();
            _subscriptionStartedHandler = new TestHandler<EventReaderSubscriptionMessage.SubscriptionStarted>();
            _notAuthorizedHandler = new TestHandler<EventReaderSubscriptionMessage.NotAuthorized>();
            _eofHandler = new TestHandler<EventReaderSubscriptionMessage.EofReached>();
            _partitionEofHandler = new TestHandler<EventReaderSubscriptionMessage.PartitionEofReached>();
            _partitionMeasuredHandler = new TestHandler<EventReaderSubscriptionMessage.PartitionMeasured>();
            _partitionDeletedHandler = new TestHandler<EventReaderSubscriptionMessage.PartitionDeleted>();

            _bus.Subscribe(_eventHandler);
            _bus.Subscribe(_checkpointHandler);
            _bus.Subscribe(_progressHandler);
            _bus.Subscribe(_eofHandler);
            _bus.Subscribe(_partitionEofHandler);
            _bus.Subscribe(_partitionMeasuredHandler);
            _readerStrategy = CreateCheckpointStrategy();
            _subscription = CreateProjectionSubscription();


            When();
        }
开发者ID:czcz1024,项目名称:EventStore,代码行数:30,代码来源:TestFixtureWithProjectionSubscription.cs


注:本文中的ITimeProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。