コード例 #1
0
        public JsonReader CreatePlayer()
        {
            int count = _tokenList == null ? 0 : _tokenList.Count;

            JsonToken[] tokens = new JsonToken[count + 2];

            if (count > 0)
            {
                _tokenList.CopyTo(tokens, 1);
            }

            tokens[0] = JsonToken.BOF();
            tokens[tokens.Length - 1] = JsonToken.EOF();

            return(new JsonPlayer(tokens));
        }
コード例 #2
0
        /// <summary>
        /// Reads the next token and returns it.
        /// </summary>

        protected override JsonToken ReadTokenImpl()
        {
            if (_stack == null)
            {
                return(JsonToken.EOF());
            }
            else if (_stack.Count == 0)
            {
                _stack  = null;
                _reader = null;
                return(JsonToken.EOF());
            }
            else
            {
                return(Pop()());
            }
        }