public void Init() { _mocks = new MockRepository(); _wr = new WorkflowRepository(new MemoryWorkItemRepository(), new MemoryWorkStepRepository()); _timeSourceStub = _mocks.Stub<ITimeSource>(); _mover = new WorkStepMover(_wr,_timeSourceStub); }
public AccountManager( ISecurityProvider securityProvider, IAccountRepository accountRepository, IAccountValidator accountValidator, ITimeSource timeSource, int accountSessionCollectionCapacity, ISessionRepository sessionRepository, IActionRightResolver actionRightResolver/*, Func<TBizAccountRegistrationData, TBizAccount> accountRegistrationDataToAccount*/) { // todo1[ak] check args _securityProvider = securityProvider; _accountRepository = accountRepository; _accountValidator = accountValidator; _timeSource = timeSource; _sessionManager = new SessionManager( _securityProvider, _timeSource, accountSessionCollectionCapacity, sessionRepository); _actionRightResolver = actionRightResolver; //_accountRegistrationDataToAccount = accountRegistrationDataToAccount; }
public SampleAttribute( string key, string displayName, Option <string> description, Option <Texture> icon, string target, TimeSpan period, ProcessMode processMode, ITimeSource timeSource, Map <string, IAttribute> children, bool active, ILoggerFactory loggerFactory) : base( key, displayName, description, icon, target, false, children, active, loggerFactory) { Ensure.That(timeSource, nameof(timeSource)).IsNotNull(); Period = period; ProcessMode = processMode; TimeSource = timeSource; }
protected override void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { if (timesource != null) { timesource.Invalidate(); } timesource = null; if (stopwatch != null) { stopwatch.Stop(); } stopwatch = null; DestroyFrameBuffer(); } base.Dispose(disposing); disposed = true; if (disposing) { OnDisposed(EventArgs.Empty); } }
public GpsPositionService( StatefulServiceContext context, ITimeSource timeSource) : base(context) { _timeSource = timeSource; }
private void SendExpired(ITimeSource timeSource) { if (_disposed) { return; } if (_pending.Count <= 0) { return; } do { var timeKey = _pending.Keys.FirstOrDefault(); if (timeKey is null) { return; } if (timeKey > timeSource.Now()) { return; } var toDispatch = _pending[timeKey]; _pending.RemoveAt(0); for (int i = 0; i < toDispatch.Count; i++) { if (Interlocked.Read(ref _stop) == True) { return; } _outbound.Publish(toDispatch[i]); } } while (_pending.Count <= 0); }
public AnimationDrivenLocomotion( AnimationTree animationTree, Skeleton skeleton, AnimationStates states, Blender2D blender, TimeScale timeScale, string idleState, string moveState, KinematicBody target, Physics3DSettings physicsSettings, ITimeSource timeSource, bool active, ILoggerFactory loggerFactory) : base(target, physicsSettings, timeSource, active, loggerFactory) { Ensure.That(animationTree, nameof(animationTree)).IsNotNull(); Ensure.That(skeleton, nameof(skeleton)).IsNotNull(); Ensure.That(states, nameof(states)).IsNotNull(); Ensure.That(blender, nameof(blender)).IsNotNull(); Ensure.That(timeScale, nameof(timeScale)).IsNotNull(); Ensure.That(idleState, nameof(idleState)).IsNotNullOrEmpty(); Ensure.That(moveState, nameof(moveState)).IsNotNullOrEmpty(); AnimationTree = animationTree; Skeleton = skeleton; States = states; Blender = blender; TimeScale = timeScale; IdleState = idleState; MoveState = moveState; }
public InjectionApi(IApiBridge bridge, Metadata metadata, Globals globals, ITimeSource timeSource, Paths paths, Objects objects) { this.bridge = bridge; UO = new InjectionApiUO(bridge, this, metadata, globals, timeSource, paths, objects); Register(metadata); this.timeSource = timeSource; }
internal InfusionTestProxy(ITimeSource timeSource, PacketDefinitionRegistry packetRegistry = null) { packetRegistry = packetRegistry ?? PacketDefinitionRegistryFactory.CreateClassicClient(); ServerPacketHandler = new ServerPacketHandler(PacketDefinitionRegistryFactory.CreateClassicClient()); ClientPacketHandler = new ClientPacketHandler(PacketDefinitionRegistryFactory.CreateClassicClient()); Server = new UltimaServer(ServerPacketHandler, packet => { var filteredPacket = ClientPacketHandler.FilterOutput(packet); if (filteredPacket.HasValue) { packetsSentToServer.Add(filteredPacket.Value); } }, packetRegistry); Client = new UltimaClient(ClientPacketHandler, packet => { var filteredPacket = ServerPacketHandler.FilterOutput(packet); if (filteredPacket.HasValue) { packetsSentToClient.Add(filteredPacket.Value); } }); var console = new NullConsole(); Api = new Legacy(new LogConfiguration(), new CommandHandler(console), Server, Client, console, packetRegistry, timeSource, ClilocSource, KeywordSource, new MemoryConfigBagRepository(), new NullInjectionWindow(), new NullSoundPlayer()); UO.Initialize(Api); ServerApi = new TestServerApi(PacketReceivedFromServer, Api); }
public void Init() { _mocks = new MockRepository(); _wr = new WorkflowRepository(new MemoryWorkItemRepository(), new MemoryWorkStepRepository()); _timeSourceStub = _mocks.Stub <ITimeSource>(); _mover = new WorkStepMover(_wr, _timeSourceStub); }
public AnimationStateManager( AnimationPlayer player, AnimationTree animationTree, Option <IAnimationGraphFactory> graphFactory, Option <IAnimationControlFactory> controlFactory, ProcessMode processMode, ITimeSource timeSource, bool active, ILoggerFactory loggerFactory) : base(player, processMode, timeSource, active, loggerFactory) { Ensure.That(animationTree, nameof(animationTree)).IsNotNull(); AnimationTree = animationTree; GraphFactory = graphFactory.IfNone(() => new AnimationGraphFactory()); ControlFactory = controlFactory.IfNone(() => new AnimationControlFactory()); Context = new AnimationGraphContext( Player, AnimationTree, OnAdvance, GraphFactory, ControlFactory, loggerFactory); _graph = GraphFactory.TryCreate((AnimationRootNode)AnimationTree.TreeRoot, Context).IfNone(() => throw new ArgumentException( "Failed to create animation graph from the specified animation tree.", nameof(animationTree))); AnimationTree.ProcessMode = AnimationTree.AnimationProcessMode.Manual; this.LogDebug("Using graph factory: {}.", GraphFactory); this.LogDebug("Using control factory: {}.", ControlFactory); }
public MetricsCollectionAspect( IMethodInvocationRecorder methodInvocationRecorder, ITimeSource timeSource) { this._methodInvocationRecorder = methodInvocationRecorder; this._timeSource = timeSource; _debugSessionStartTimestampUs = _timeSource.GetTimestampUs(); }
public InjectionApi(IApiBridge bridge, Metadata metadata, InjectionRuntimeState state, ITimeSource timeSource, Paths paths) { this.bridge = bridge; UO = new InjectionApiUO(bridge, this, metadata, state, timeSource, paths); Register(metadata); this.timeSource = timeSource; }
public DemoTimeSource(bool isLooping) { SoundFileName = string.Empty; timeSource = new TimeSource(10.0f); timeSource.IsLooping = isLooping; timeSource.OnTimeFinished += CallOnTimeFinished; }
public EntityLabel( IPlayerControl playerControl, string interactAction, Label titleLabel, Option <Label> shortcutLabel, Option <Label> actionLabel, Option <Godot.Control> actionPanel, ITimeSource timeSource, Godot.Control node, ILoggerFactory loggerFactory) : base(node, loggerFactory) { Ensure.That(playerControl, nameof(playerControl)).IsNotNull(); Ensure.That(interactAction, nameof(interactAction)).IsNotNull(); Ensure.That(titleLabel, nameof(titleLabel)).IsNotNull(); Ensure.That(timeSource, nameof(timeSource)).IsNotNull(); PlayerControl = playerControl; InteractAction = interactAction; TitleLabel = titleLabel; ShortcutLabel = shortcutLabel; ActionLabel = actionLabel; ActionPanel = actionPanel; TimeSource = timeSource; InteractAction = interactAction; }
/// <summary> /// Appends byte[] items to archive. The instance is NOT thread-safe /// </summary> public BinaryArchiveAppender(IVolume volume, ITimeSource time, Atom app, string host, Action <byte[], Bookmark> onPageCommit = null) : base(volume, time, app, host, onPageCommit) { }
/// <summary> /// Calculates the last date for an Id before a 'wrap around' will occur in the timestamp-part of an Id for the /// given <see cref="IdStructure"/>. /// </summary> /// <param name="epoch">The used epoch for the <see cref="IdGenerator"/> to use as offset.</param>' /// <param name="timeSource">The used <see cref="ITimeSource"/> for the <see cref="IdGenerator"/>.</param> /// <returns>The last date for an Id before a 'wrap around' will occur in the timestamp-part of an Id.</returns> /// <remarks> /// Please note that for dates exceeding the <see cref="DateTimeOffset.MaxValue"/> an /// <see cref="ArgumentOutOfRangeException"/> will be thrown. /// </remarks> /// <exception cref="ArgumentOutOfRangeException"> /// Thrown when any combination of a <see cref="ITimeSource.TickDuration"/> and <see cref="MaxIntervals"/> /// results in a date exceeding the <see cref="TimeSpan.MaxValue"/> value. /// </exception> public DateTimeOffset WraparoundDate(DateTimeOffset epoch, ITimeSource timeSource) { if (timeSource == null) { throw new ArgumentNullException(nameof(timeSource)); } return(epoch.AddDays(timeSource.TickDuration.TotalDays * MaxIntervals)); }
/// <summary> /// Calculates the interval at wich a 'wrap around' will occur in the timestamp-part of an Id for the given /// <see cref="IdStructure"/>. /// </summary> /// <param name="timeSource">The used <see cref="ITimeSource"/> for the <see cref="IdGenerator"/>.</param> /// <returns> /// The interval at wich a 'wrap around' will occur in the timestamp-part of an Id for the given /// <see cref="IdStructure"/>. /// </returns> /// <remarks> /// Please note that for intervals exceeding the <see cref="TimeSpan.MaxValue"/> an /// <see cref="OverflowException"/> will be thrown. /// </remarks> /// <exception cref="ArgumentNullException"> /// Thrown when <paramref name="timeSource"/> is null. /// </exception> /// <exception cref="OverflowException"> /// Thrown when any combination of a <see cref="ITimeSource.TickDuration"/> and <see cref="MaxIntervals"/> /// results in a TimeSpan exceeding the <see cref="TimeSpan.MaxValue"/> value. /// </exception> public TimeSpan WraparoundInterval(ITimeSource timeSource) { if (timeSource == null) { throw new ArgumentNullException(nameof(timeSource)); } return(TimeSpan.FromDays(timeSource.TickDuration.TotalDays * MaxIntervals)); }
/// <summary> /// Appends string items to archive. The instance is NOT thread-safe /// </summary> public JsonArchiveAppender(IVolume volume, ITimeSource time, Atom app, string host, Action <object, Bookmark> onPageCommit = null) : base(volume, time, app, host, onPageCommit) { }
public SystemRoleLogic(ISystemRoleRepository systemRoleRepository, IUnitOfWorkFactory unitOfWorkFactory, ITimeSource timeSource) { _systemRoleRepository = systemRoleRepository; _unitOfWorkFactory = unitOfWorkFactory; _timeSource = timeSource; }
public TestDebuggerFacade(ITimeSource timeSource) { ScriptCancellation = new CancellationTokenSource(); debuggerServer = new DebuggerServer(() => ScriptCancellation.Token); runtime = new InjectionRuntime(null, debuggerServer, timeSource, () => ScriptCancellation.Token); tracer = debuggerServer; debuggerServer.DebuggerBreakHit += HandleDebuggerBreakHit; }
internal Step(StepsRecorder stepsRecorder, ITimeSource timeSource, ExpressionEvaluationEngine engine) { _startTicks = timeSource.GetTimestampTicks(); _stepsRecorder = stepsRecorder; _timeSource = timeSource; _engine = engine; _finalized = false; }
internal InjectionApiUO(IApiBridge bridge, InjectionApi injectionApi, Metadata metadata, Globals globals, ITimeSource timeSource) { this.bridge = bridge; this.injectionApi = injectionApi; this.globals = globals; Register(metadata); random = new Random(); this.timeSource = timeSource; }
public TrackingService(ITimeSource timeSource = null) { this.timeSource = timeSource ?? new RealTimeSource(); this.reportSendTimer = new Timer(30000); this.reportSendTimer.Elapsed += (sender, e) => this.PublishReports(TimeSpan.FromMinutes(5)); this.reportSendTimer.Start(); this.reportsSubject = new Subject <ITrackingReport>(); this.Reports = this.reportsSubject; }
public virtual ITimeSource GetTimeSource() { if (_timeSource == null) { _timeSource = new StopwatchTimeSource(); } return(_timeSource); }
public ImmediateLocomotion( Spatial target, ProcessMode processMode, ITimeSource timeSource, bool active, ILoggerFactory loggerFactory) : base(target, timeSource, active, loggerFactory) { ProcessMode = processMode; }
public LaterService(IPublisher outbound, ITimeSource timeSource) { _outbound = outbound; _timeSource = timeSource; _inbound = new ConcurrentQueue <DelaySendEnvelope>(); //we can use a simple sorted list here because it is only accessed on the processing thread _pending = new SortedList <TimePosition, List <Message> >(); _processNext = new ManualResetEventSlim(true); }
public void Stop() { if (timeSource != null) { timeSource.Invalidate(); timeSource = null; } DestroyFramebuffer(); }
public SeekBar() { InitializeComponent(); defaultTimeSource = new TimeSource(10.0f); timeSource = defaultTimeSource; timeSource.IsLooping = true; timeSource.OnTimeFinished += CallOnFinished; markerBarPosition.Max = timeSource.Length; Playing = false; }
public TrackingSession(string code, string sessionId, string ip, ITimeSource timeSource) { this.Code = code; this.sessionId = sessionId; this.ip = ip; this.timeSource = timeSource; this.createTime = timeSource.Now; this.topicEvents = new List <Tuple <DateTime, TrackTopicsEvent> >(); this.urlTrackEvents = new List <Tuple <DateTime, UrlTrackingEvent> >(); }
public RoleLogicService(IRoleRepository roleRepository, IUnitOfWorkFactory unitOfWorkFactory, ITimeSource timeSource, IUserAuthenticationManager userAuthenticationManager) { _roleRepository = roleRepository ?? throw new ArgumentNullException(nameof(roleRepository)); _unitOfWorkFactory = unitOfWorkFactory ?? throw new ArgumentNullException(nameof(unitOfWorkFactory)); _timeSource = timeSource ?? throw new ArgumentNullException(nameof(timeSource)); _userAuthenticationManager = userAuthenticationManager ?? throw new ArgumentNullException(nameof(userAuthenticationManager)); }
public void Stop() { AssertValid(); if (timesource != null) { timesource.Invalidate (); timesource = null; } suspended = false; OnUnload(EventArgs.Empty); }
public void Run() { if (timeSource != null) { timeSource.Invalidate(); } timeSource = new CADisplayLinkTimeSource(this, frameInterval: 1); SetupContextAndFramebuffer(); prevUpdateTime = TimeSpan.Zero; Resume(); }
public SystemUserLogic(ISystemUserRepository systemUserRepository, ICacheManager cacheManager, IUnitOfWorkFactory unitOfWorkFactory, ITimeSource timeSource) { _systemUserRepository = systemUserRepository; _cacheManager = cacheManager; _unitOfWorkFactory = unitOfWorkFactory; _timeSource = timeSource; }
internal SessionManager(ISecurityProvider securityProvider, ITimeSource timeSource, int accountSessionCollectionCapacity, ISessionRepository sessionRepository) { // todo1[ak] check args _securityProvider = securityProvider; _timeSource = timeSource; _accountSessionCollectionCapacity = accountSessionCollectionCapacity; _accountSessions = new Dictionary<string, IAccountSessionCollection>(); _lock = new object(); _allSessions = new Dictionary<string, BizSession>(); _sessionRepository = sessionRepository; }
public void Run(double updatesPerSecond) { if (updatesPerSecond < 0.0) throw new ArgumentException ("updatesPerSecond"); if (updatesPerSecond == 0.0) { RunWithFrameInterval (1); return; } if (timesource != null) timesource.Invalidate (); timesource = new NSTimerTimeSource (this, updatesPerSecond); CreateFrameBuffer (); OnLoad (EventArgs.Empty); Start (); }
public MockTimeSink(ITimeSource timeSource) { _timeSource = timeSource; }
public WorkItemCreator(IWorkflowRepository workflowRepository, ITimeSource timeSource) : base(workflowRepository) { _timeSource = timeSource; }
internal static IAccountManager CreateAdminManager( ITimeSource timeSource, IAccountRepository adminRepository, ISessionRepository sessionRepository, int accountSessionCollectionCapacity, IActionRightResolver actionRightResolver) { ISecurityProvider securityProvider = CreateAdminSecurityProvider(); IAccountValidator adminValidator = CreateAdminValidator(); IAccountManager adminManager = new AccountManager( securityProvider, adminRepository, adminValidator, timeSource, accountSessionCollectionCapacity, sessionRepository, actionRightResolver); return adminManager; }
public static IAccountManager CreateUserManager( ITimeSource timeSource, IAccountRepository userRepository, ISessionRepository sessionRepository, int accountSessionCollectionCapacity, IActionRightResolver actionRightResolver) { ISecurityProvider securityProvider = CreateUserSecurityProvider(); IAccountValidator userValidator = CreateUserValidator(); IAccountManager userManager = new AccountManager( securityProvider, userRepository, userValidator, timeSource, accountSessionCollectionCapacity, sessionRepository, actionRightResolver); return userManager; }
public WorkStepMover(IWorkflowRepository workflowRepository, ITimeSource timeSource) { _workflowRepository = workflowRepository; _timeSource = timeSource; }
public WorkItemMover(IWorkflowRepository workflowRepository, ITimeSource timeSource) : base(workflowRepository) { _timeSource = timeSource; WipLimitChecker = new WipLimitChecker(workflowRepository); }
public PipelineReportViewModel(PipelineReport pipelineReport, ITimeSource timeSource) { _pipelineReport = pipelineReport; _timeSource = timeSource; }
public void RunWithFrameInterval(int frameInterval) { AssertValid (); if (frameInterval < 1) throw new ArgumentException ("frameInterval"); if (timesource != null) timesource.Invalidate (); timesource = new CADisplayLinkTimeSource (this, frameInterval); CreateFrameBuffer (); OnLoad (EventArgs.Empty); Start (); }
protected override void Dispose(bool disposing) { if (disposed) return; if (disposing) { if (timesource != null) timesource.Invalidate (); timesource = null; if (stopwatch != null) stopwatch.Stop(); stopwatch = null; DestroyFrameBuffer(); } base.Dispose (disposing); disposed = true; if (disposing) OnDisposed(EventArgs.Empty); }
public void Clear() { Debug.Assert(null != timeSource); //keep looping state bool isLooping = timeSource.IsLooping; //remove old timeSource.Dispose(); //create new timeSource = new TimeSource(10.0f); SoundFileName = string.Empty; timeSource.IsLooping = isLooping; timeSource.OnTimeFinished += CallOnTimeFinished; OnLoaded?.Invoke(this, EventArgs.Empty); }
public void Load(ITimeSource newTimeSource) { Debug.Assert(null != timeSource); if (null == newTimeSource) { Clear(); } else { newTimeSource.IsLooping = IsLooping; newTimeSource.OnTimeFinished += CallOnTimeFinished; timeSource.Dispose(); timeSource = newTimeSource; OnLoaded?.Invoke(this, EventArgs.Empty); } }