private void InitiateAddingItemsToDB() { _dispose?.Dispose(); _dispose = null; waitSub?.Dispose(); waitSub = null; _dispose = new BehaviorSubject <bool>(true); var currentSliderSpeed = ((ThoughtEntryVM)this.BindingContext).Speed; var adjustedSpeed = currentSliderSpeed * 2; waitSub?.Dispose(); if (Convert.ToInt32(currentSliderSpeed) != 100 && Convert.ToInt32(currentSliderSpeed) != 0) { waitSub = Observable .Interval(TimeSpan.FromMilliseconds(adjustedSpeed)) .TakeUntil(_dispose.Where(p => !p)) //.Take(1) .Subscribe(val => { if (jsonString == null) { jsonString = JsonConvert.SerializeObject(new List <string>() { "Me", "You", "Us" }); } var newobj = JsonConvert.DeserializeObject(jsonString); ((ThoughtEntryVM)this.BindingContext).AutoThought = JsonConvert.SerializeObject(newobj); ((ThoughtEntryVM)this.BindingContext).AutoGetNumberOfRows = true; ((ThoughtEntryVM)this.BindingContext).AutoGetDBSize = true; }); } }
public void Dispose() { _connectionStatus?.Dispose(); _readData?.OnCompleted(); _readData?.Dispose(); Close(null); }
public void Dispose() { _filterStateSubject?.Dispose(); _reduceStateSubject?.Dispose(); _resetSubject?.Dispose(); _disposables?.Dispose(); }
private async Task CompleteAsync() { Debug.WriteLine("disposing GraphQLHttpWebSocket..."); _incomingMessagesConnection?.Dispose(); if (!_internalCancellationTokenSource.IsCancellationRequested) { _internalCancellationTokenSource.Cancel(); } await CloseAsync(); _requestSubscription?.Dispose(); _clientWebSocket?.Dispose(); _stateSubject?.OnCompleted(); _stateSubject?.Dispose(); _exceptionSubject?.OnCompleted(); _exceptionSubject?.Dispose(); _internalCancellationTokenSource.Dispose(); _sendLoopScheduler?.Dispose(); _receiveLoopScheduler?.Dispose(); Debug.WriteLine("GraphQLHttpWebSocket disposed"); }
public void Value_ThrowsOnDispose() { var s = new BehaviorSubject <int>(42); Assert.AreEqual(42, s.Value); s.Dispose(); Assert.Fail("Should not be able to read Value: {0}", s.Value); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposing) { return; } collectionChangedSubject?.Dispose(); }
public void HasObservers_Dispose3() { var s = new BehaviorSubject <int>(42); Assert.False(s.HasObservers); Assert.False(s.IsDisposed); s.Dispose(); Assert.False(s.HasObservers); Assert.True(s.IsDisposed); }
protected virtual void dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _provider.Dispose(); } _disposedValue = true; } }
protected override Task DestroyInternal() { _cancel.Cancel(); _state.OnCompleted(); _state.Dispose(); _publisherSocket.Close(); _publisherSocket.Dispose(); return(Task.CompletedTask); }
protected virtual void Dispose(bool disposing) { if (!_isDisposed) { if (disposing) { _isReloadingData?.Dispose(); } _isDisposed = true; } }
public override Task Stop() { _cancel.Cancel(); _poller.Stop(); _client.Close(); _client.Dispose(); _isConnected.OnCompleted(); _isConnected.Dispose(); return(Task.CompletedTask); }
protected virtual void Dispose(bool isDisposing) { if (_isDisposed) { return; } if (isDisposing) { _isReloadingData?.Dispose(); } _isDisposed = true; }
protected override void Dispose(bool disposing) { if (_disposed == false) { if (disposing) { _observables.OnCompleted(); _recorder.Dispose(); _observables.Dispose(); } _disposed = true; } base.Dispose(disposing); }
protected async override Task DestroyInternal() { _cancel.Cancel(); _state.OnCompleted(); _state.Dispose(); _publisherSocket.Close(); _publisherSocket.Dispose(); _heartbeatPoller.Stop(); await WaitForWorkProceduresToComplete(_heartbeatProc); }
public void Value_ThrowsOnDispose() { var s = new BehaviorSubject <int>(42); Assert.Equal(42, s.Value); s.Dispose(); ReactiveAssert.Throws <ObjectDisposedException>(() => { var ignored = s.Value; }); Assert.False(s.TryGetValue(out var x)); }
protected async override Task DestroyInternal() { _cancel.Cancel(); _cleanup.Dispose(); _state.OnCompleted(); _state.Dispose(); _sourceCache.Dispose(); _cacheUpdatePoller.Stop(); _heartbeatPoller.Stop(); await WaitForWorkProceduresToComplete(_workProc, _heartbeatProc, _caughtUpWithStateOfTheWorldProc); }
protected override Task DestroyInternal() { _cancel.Cancel(); _observeCacheState.Dispose(); _state.OnCompleted(); _state.Dispose(); _sourceCache.Dispose(); _cacheUpdateSocket.Close(); _cacheUpdateSocket.Dispose(); return(Task.CompletedTask); }
/// <summary> /// Unsubcribe all subscription. /// </summary> public void Dispose() { if (isDisposed) { return; } isDisposed = true; anotherTrigger.Dispose(); raiseSubscription.Dispose(); sourceDisposable.Dispose(); ((IDisposable)validationTrigger).Dispose(); validateNotifyErrorSubscription.Dispose(); errorsTrigger.OnCompleted(); errorsTrigger.Dispose(); }
/// <summary> /// Unsubcribe all subscription. /// </summary> public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; AnotherTrigger.Dispose(); RaiseSubscription.Dispose(); SourceDisposable.Dispose(); ((IDisposable)ValidationTrigger).Dispose(); ValidateNotifyErrorSubscription.Dispose(); ErrorsTrigger.OnCompleted(); ErrorsTrigger.Dispose(); }
// TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. // ~NavigationService() // { // // Do not change this code. Put cleanup code in Dispose(bool disposing) above. // Dispose(false); // } /// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { _modalSubject?.Dispose(); _navigationSubject?.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer. // TODO: set large fields to null. disposedValue = true; } }
public void HasObservers_Dispose2() { var s = new BehaviorSubject <int>(42); Assert.IsFalse(s.HasObservers); var d = s.Subscribe(_ => { }); Assert.IsTrue(s.HasObservers); d.Dispose(); Assert.IsFalse(s.HasObservers); s.Dispose(); Assert.IsFalse(s.HasObservers); }
// Start is called before the first frame update void Start() { var behaviorSubject = new BehaviorSubject <int>(0); //behaviorSubject.OnNext(1); //behaviorSubject.OnNext(2); //behaviorSubject.OnNext(3); behaviorSubject.Subscribe( x => Debug.Log("OnNext:" + x), ex => Debug.LogError("OnError:" + ex), () => Debug.Log("OnCompleted")); behaviorSubject.OnNext(4); behaviorSubject.OnCompleted(); behaviorSubject.Dispose(); }
private void Dispose(bool isDisposing) { if (_notifySubscription != null) { _notifySubscription.Dispose(); _notifySubscription = null; } if (_values != null) { _values.Dispose(); _values = null; } if (isDisposing) { GC.SuppressFinalize(this); } }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { // Dispose managed resources. Shutdown(); _stateSubject.Dispose(); _eventGenerator.Dispose(); } // Dispose unmanaged resources. // Set disposed flag. _disposed = true; }
protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { disposables.Dispose(); if (sharp7 != null) { sharp7.Disconnect(); sharp7 = null; } connectionStateSubject?.Dispose(); } disposed = true; } }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { // Dispose managed resources. Close(); AfterClose(); _isSessionReady.Dispose(); _playFailed.Dispose(); } // Dispose unmanaged resources. // Set disposed flag. _disposed = true; }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { // Dispose managed resources. _controlSubject.Dispose(); _generalSubject.Dispose(); Disconnect(); _isConnected.Dispose(); _sendControlLock.Dispose(); _sendGeneralLock.Dispose(); } // Dispose unmanaged resources. // Set disposed flag. _disposed = true; }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { // Dispose managed resources. Stop(); Disconnect(); _playStarted.Dispose(); _videoStreamInfo.Subject.Dispose(); _audioStreamInfo.Subject.Dispose(); _rtspClient.Dispose(); } // Dispose unmanaged resources. // Set disposed flag. _disposed = true; }
public void Dispose() { Stop(); _intervalSubscription?.Dispose(); _fileScanned?.Dispose(); }
public void Value_ThrowsOnDispose() { var s = new BehaviorSubject<int>(42); Assert.AreEqual(42, s.Value); s.Dispose(); Assert.Fail("Should not be able to read Value: {0}", s.Value); }
public void HasObservers_Dispose3() { var s = new BehaviorSubject<int>(42); Assert.IsFalse(s.HasObservers); s.Dispose(); Assert.IsFalse(s.HasObservers); }
public void HasObservers_Dispose2() { var s = new BehaviorSubject<int>(42); Assert.IsFalse(s.HasObservers); var d = s.Subscribe(_ => { }); Assert.IsTrue(s.HasObservers); d.Dispose(); Assert.IsFalse(s.HasObservers); s.Dispose(); Assert.IsFalse(s.HasObservers); }
public void Value_ThrowsOnDispose() { var s = new BehaviorSubject<int>(42); Assert.AreEqual(42, s.Value); s.Dispose(); ReactiveAssert.Throws<ObjectDisposedException>(() => { var ignored = s.Value; }); var x = default(int); Assert.IsFalse(s.TryGetValue(out x)); }
public void Dispose() { logs?.Dispose(); lastSequenceToken?.Dispose(); subscription?.Dispose(); }
/// <summary> /// トリガーにかかるか例外が出るまで待つ /// </summary> /// <param name="bs"></param> /// <param name="trigger"></param> /// <param name="status"></param> /// <returns></returns> private async Task WaitTriggerAsync(BehaviorSubject<bool> bs, IDisposable trigger, StatusItem status) { await this.SendLineAsync(null); this.StatusSubject.OnNext(status); var waiting = await bs .Where(x => x) .Select(x => new WaitResultContainer(null)) .Merge(this.ExceptionObservable) .Take(1); trigger.Dispose(); bs.Dispose(); if (!waiting.IsSucceeded) { throw waiting.Exception; } await this.WaitIfPausingAsync(); }