Example #1
0
        /// <summary>
        /// Move to next message in the stream.
        /// If it returns false, there are no more messages.  The enumerator is still
        ///  valid however and can be called again when more data has come in on this
        ///  stream.
        /// </summary>
        /// <returns></returns>
        public virtual bool MoveNext()
        {
            if (current == null && IsSet && IsInStream(Element.Value.Batch))
            {
                current = Element.Value.Batch;
                return(true);
            }

            IBatchContainer next;

            while (cache.TryGetNextMessage(this, out next))
            {
                if (IsInStream(next))
                {
                    break;
                }
            }
            current = next;
            if (!IsInStream(next))
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// Move to next message in the stream.
        /// If it returns false, there are no more messages.  The enumerator is still
        ///  valid howerver and can be called again when more data has come in on this
        ///  stream.
        /// </summary>
        /// <returns></returns>
        public virtual bool MoveNext()
        {
            IBatchContainer next;

            while (cache.TryGetNextMessage(this, out next))
            {
                if (IsInStream(next))
                {
                    break;
                }
            }
            if (!IsInStream(next))
            {
                return(false);
            }

            current = next;
            return(true);
        }