本文整理汇总了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;
}
示例2: BrowserExecutionContextCreator
public BrowserExecutionContextCreator(IBrowserStepExecutionStrategyFactory stepExecutionStrategyFactory,
IWebDriverFactory webDriverFactory, ITimeProvider timeProvider)
{
_stepExecutionStrategyFactory = stepExecutionStrategyFactory;
_webDriverFactory = webDriverFactory;
_timeProvider = timeProvider;
}
示例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;
}
示例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;
}
示例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);
}
示例6: Create
public static IReaderStrategy Create(
ISourceDefinitionConfigurator sources, ITimeProvider timeProvider, IPrincipal runAs)
{
var builder = new Builder();
sources.ConfigureSourceProcessingStrategy(builder);
return builder.Build(timeProvider, runAs);
}
示例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 );
}
示例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;
}
示例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);
}
示例10: CommandCreator
protected CommandCreator(IOutputManager outputManager, ITimeProvider timeProvider, IMessagesRepository messagesRepository, IFollowingRepository followingRepository)
{
OutputManager = outputManager;
TimeProvider = timeProvider;
MessagesRepository = messagesRepository;
FollowingRepository = followingRepository;
}
示例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);
}
示例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
}
示例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()));
}
示例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);
}
示例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();
}