protected void Init() { Errors.Clear(); Results.Clear(); Error = null; Result = default(T); Counter = 0; Subscription.DisposeSafe(); Subscriptions.DisposeSafe(); Subscriptions = new CompositeDisposable(); }
private void Reload(bool force, StorageUpdated msg = null) { logger.Information("Initialize {EntityType}", msg?.Entity?.GetType()?.Name); if (msg != null) { switch (msg.Entity) { //case RecordingSessionDto: case CheckpointDto: //case TimingSessionDto: return; } } var timingSession = eventRepository.StorageService.Get(Id); if (!timingSession.IsRunning && !force) { return; } logger.Information("Initialize updating subscription"); disposable?.DisposeSafe(); disposable = new CompositeDisposable(); var session = eventRepository.GetWithUpstream(timingSession.SessionId); GateId = eventRepository.GetGateId(timingSession.SessionId); checkpointHandler = new TimingCheckpointHandler(timingSession.StartTime, Id, session, eventRepository.GetRiderIdentifiers(timingSession.SessionId), messageHub); disposable.Add(checkpointHandler); var cps = recordingServiceRepository .GetCheckpoints(timingSession.GateId, timingSession.StartTime, timingSession.StopTime); foreach (var cp in cps) { recordingService.AppendCheckpoint(GateId, autoMapper.Map <Checkpoint>(cp)); } }
void DisableRfid() { disposable.DisposeSafe(); }
public void Dispose() { disposable.DisposeSafe(); }