Beispiel #1
0
        public IAsyncEnumerator <TSource> GetAsyncEnumerator()
        {
            var en = new TakeUntilEnumerator(_source.GetAsyncEnumerator(), _other.GetAsyncEnumerator());

            en.MoveNextOther();
            return(en);
        }
        public IAsyncEnumerator <TSource> GetAsyncEnumerator(CancellationToken cancellationToken)
        {
            var cancelMain  = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
            var cancelOther = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
            var en          = new TakeUntilEnumerator(_source.GetAsyncEnumerator(cancelMain.Token), _other.GetAsyncEnumerator(cancelOther.Token), cancelMain, cancelOther);

            en.MoveNextOther();
            return(en);
        }