Пример #1
0
        /// <summary>
        /// Advances to the next array element if any, and returns <see langword="true"/> if successful.
        /// </summary>
        /// <remarks>
        /// <para>
        /// It returns <see langword="false"/> if the <c>JReader</c> has reached the end of the array, or
        /// if the array was empty or null.
        /// </para>
        /// <para>
        /// If <c>Next</c> returns <see langword="true"/>, you can then use <see cref="JReader"/> methods
        /// such as <see cref="JReader.Bool"/> to read the element value. If you do not care about the
        /// value, simply calling <c>Next</c> again without calling a <c>JReader</c> method will discard
        /// the value.
        /// </para>
        /// <para>
        /// For more information about why <c>Next</c> requires a <c>ref</c> parameter, see
        /// <see cref="JReader"/>.
        /// </para>
        /// </remarks>
        /// <param name="reader">the original <see cref="JReader"/> (must be passed by reference)</param>
        /// <returns><see langword="true"/> if there is a next array element</returns>
        public bool Next(ref JReader reader)
        {
            if (!_defined)
            {
                return(false);
            }
            var hasNext = reader.ArrayNext(!_afterFirst);

            _afterFirst = true;
            return(hasNext);
        }